<html><head><base href="x-msg://64/"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi John,<div><br></div><div> To answer your original question on how to list all tags owned by a given user...</div><div><br></div><div><div>>>> params = omero.sys.ParametersI()</div><div>>>> eid = conn.getUserId()<span class="Apple-tab-span" style="white-space:pre"> </span># current user</div><div><div>>>> params.theFilter = omero.sys.Filter()</div></div><div>>>> params.theFilter.ownerId = rlong(eid)</div></div><div><div>>>> tags = conn.getObjects("TagAnnotation", params=params)</div></div><div><br></div><div> Hope that helps,</div><div><br></div><div> Will.</div><div><br></div><div><br></div><div><br><div><div>On 13 Mar 2014, at 14:47, John Webber (NBI) wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div lang="EN-GB" link="#0563C1" vlink="#954F72"><div class="WordSection1" style="page: WordSection1; "><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="color: rgb(31, 73, 125); ">All,<o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="color: rgb(31, 73, 125); "><o:p> </o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="color: rgb(31, 73, 125); ">I have solved the issue – after a lot of attempts, research and a little swearing!<o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="color: rgb(31, 73, 125); "><o:p> </o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="color: rgb(31, 73, 125); ">I have done the following to search for a given “tag”:<o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="color: rgb(31, 73, 125); "><o:p> </o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; text-indent: 36pt; "><span style="color: rgb(31, 73, 125); ">obs = Blitz.getObjects("TagAnnotation", attributes={'textValue':tag})<o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; text-indent: 36pt; "><span style="color: rgb(31, 73, 125); ">obs = list(obs)<o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="color: rgb(31, 73, 125); "><o:p> </o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="color: rgb(31, 73, 125); ">If this returns a blank list, I create the tag and link it to the Image as required. If this returns any items, then I do the following to link the existing tag to the image:<o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; text-indent: 36pt; "><span style="color: rgb(31, 73, 125); "><o:p> </o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; text-indent: 36pt; "><span style="color: rgb(31, 73, 125); ">upServ = conn.getUpdateService()<o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; text-indent: 36pt; "><span style="color: rgb(31, 73, 125); ">link = ImageAnnotationLinkI()<o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; text-indent: 36pt; "><span style="color: rgb(31, 73, 125); ">link.setParent(ImageI(im_id, False))<o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; text-indent: 36pt; "><span style="color: rgb(31, 73, 125); ">link.setChild(obs[0]._obj)<o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; text-indent: 36pt; "><span style="color: rgb(31, 73, 125); ">ret = upServ.saveAndReturnObject(link)<o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="color: rgb(31, 73, 125); "><o:p> </o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="color: rgb(31, 73, 125); ">Thanks<o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="color: rgb(31, 73, 125); ">John<o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="color: rgb(31, 73, 125); "><o:p> </o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="color: rgb(31, 73, 125); "><o:p> </o:p></span></div><div><div style="border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; border-top-style: solid; border-top-color: rgb(225, 225, 225); border-top-width: 1pt; padding-top: 3pt; padding-right: 0cm; padding-bottom: 0cm; padding-left: 0cm; "><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><b><span lang="EN-US">From:</span></b><span lang="EN-US"><span class="Apple-converted-space"> </span><a href="mailto:ome-users-bounces@lists.openmicroscopy.org.uk" style="color: rgb(5, 99, 193); text-decoration: underline; ">ome-users-bounces@lists.openmicroscopy.org.uk</a><span class="Apple-converted-space"> </span>[mailto:ome-users-bounces@lists.openmicroscopy.org.uk]<span class="Apple-converted-space"> </span><b>On Behalf Of<span class="Apple-converted-space"> </span></b>John Webber (NBI)<br><b>Sent:</b><span class="Apple-converted-space"> </span>13 March 2014 10:47<br><b>To:</b><span class="Apple-converted-space"> </span><a href="mailto:ome-users@lists.openmicroscopy.org.uk" style="color: rgb(5, 99, 193); text-decoration: underline; ">ome-users@lists.openmicroscopy.org.uk</a><br><b>Subject:</b><span class="Apple-converted-space"> </span>[ome-users] List all tags<o:p></o:p></span></div></div></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><o:p> </o:p></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; ">All,<o:p></o:p></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><o:p> </o:p></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; ">Please can you advice how I can list all of the tags owned by a given Omero user account, using the Omero APIs?<o:p></o:p></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><o:p> </o:p></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; ">I am able to list all tags for a project, dataset or an image, using code like the following:<o:p></o:p></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><o:p> </o:p></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "> img = Blitz.getObject("Image", "479")<o:p></o:p></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "> for ann in img.listAnnotations():<o:p></o:p></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "> if ann.OMERO_TYPE == tag_type:<o:p></o:p></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; text-indent: 36pt; "><do something><o:p></o:p></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><o:p> </o:p></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; ">Please can anyone assist in listing the tags for a specific user?<o:p></o:p></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><br>Thanks<o:p></o:p></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; ">John<o:p></o:p></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><o:p> </o:p></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><o:p> </o:p></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><o:p> </o:p></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; line-height: 12pt; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: white; "><b><span style="font-size: 10pt; font-family: Arial, sans-serif; color: rgb(79, 129, 189); ">-------------------------------------------------------------------------------------------------------------------------------------------- </span></b><span style="color: rgb(15, 18, 111); "><o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; line-height: 12pt; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: white; "><b><span style="font-family: Arial, sans-serif; color: rgb(84, 141, 212); ">John Webber<br></span></b><span style="color: rgb(31, 73, 125); ">Computing and Information Services</span><span style="color: rgb(15, 18, 111); "><o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; line-height: 12pt; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: white; "><span style="color: rgb(31, 73, 125); ">NBI Partnership Ltd</span><span style="color: rgb(15, 18, 111); "><o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; line-height: 12pt; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: white; "><span style="color: rgb(31, 73, 125); ">Norwich Research park</span><span style="color: rgb(15, 18, 111); "><o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; line-height: 12pt; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: white; "><span style="color: rgb(31, 73, 125); ">Colney Lane</span><span style="color: rgb(15, 18, 111); "><o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; line-height: 12pt; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: white; "><span style="color: rgb(31, 73, 125); ">Norwich</span><span style="color: rgb(15, 18, 111); "><o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; line-height: 12pt; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: white; "><span style="color: rgb(31, 73, 125); ">NR4 7UH</span><span style="color: rgb(15, 18, 111); "><o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; line-height: 12pt; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: white; "><span style="color: rgb(31, 73, 125); "> </span><span style="color: rgb(15, 18, 111); "><o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; line-height: 12pt; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: white; "><span style="color: rgb(31, 73, 125); ">E-Mail:</span><span><span class="Apple-converted-space"> </span><span style="color: rgb(31, 73, 125); "><a href="mailto:john.webber@nbi.ac.uk" style="color: rgb(5, 99, 193); text-decoration: underline; "><span style="color: blue; ">john.webber@nbi.ac.uk</span></a></span><span style="color: rgb(15, 18, 111); "><o:p></o:p></span></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; line-height: 12pt; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: white; "><span style="color: rgb(31, 73, 125); ">Web:</span><span><span class="Apple-converted-space"> </span><span style="color: rgb(31, 73, 125); "> <span class="Apple-converted-space"> </span><a href="http://www.nbi.ac.uk/" style="color: rgb(5, 99, 193); text-decoration: underline; "><span style="color: blue; ">http://www.nbi.ac.uk</span></a></span><span style="color: rgb(15, 18, 111); "><o:p></o:p></span></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; line-height: 12pt; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: white; "><span style="color: rgb(31, 73, 125); ">Tel:</span><span><span class="Apple-converted-space"> </span><span style="color: rgb(31, 73, 125); "> +44(0)1603 450 818<o:p></o:p></span></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; line-height: 12pt; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: white; "><span style="color: rgb(31, 73, 125); "><o:p> </o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; line-height: 12pt; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: white; "><span style="color: rgb(31, 73, 125); ">Helpdesk (Tel): 1234</span><span><span class="Apple-converted-space"> </span><span style="color: rgb(31, 73, 125); "> HPC Support (Web):</span><span class="Apple-converted-space"> </span><span style="color: rgb(31, 73, 125); "> <span class="Apple-converted-space"> </span><a href="http://hpc.nbi.ac.uk/" style="color: rgb(5, 99, 193); text-decoration: underline; "><span style="color: blue; ">http://hpc.nbi.ac.uk</span></a> (NBI internal)<o:p></o:p></span></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; line-height: 12pt; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: white; "><span style="color: rgb(31, 73, 125); "> HPC Support (Tel):</span><span><span class="Apple-converted-space"> </span><span style="color: rgb(31, 73, 125); "> 2003 (NBI internal)<o:p></o:p></span></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="color: rgb(31, 73, 125); "> </span><span style="color: rgb(15, 18, 111); "><o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><i><span style="color: rgb(31, 73, 125); ">The NBI Partnership Ltd provides non-scientific services to the Institute of Food Research, the John Innes Centre, The Genome Analysis Centre and The Sainsbury Laboratory</span></i><span style="color: rgb(15, 18, 111); "><o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><o:p> </o:p></div></div>_______________________________________________<br>ome-users mailing list<br><a href="mailto:ome-users@lists.openmicroscopy.org.uk" style="color: rgb(5, 99, 193); text-decoration: underline; ">ome-users@lists.openmicroscopy.org.uk</a><br><a href="http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-users" style="color: rgb(5, 99, 193); text-decoration: underline; ">http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-users</a><br>_______________________________________________<br>ome-users mailing list<br><a href="mailto:ome-users@lists.openmicroscopy.org.uk" style="color: rgb(5, 99, 193); text-decoration: underline; ">ome-users@lists.openmicroscopy.org.uk</a><br><a href="http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-users" style="color: rgb(5, 99, 193); text-decoration: underline; ">http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-users</a><br></div></blockquote></div><br></div></body></html>