We're Hiring!

displaying selective projects on OMERO.web

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.

displaying selective projects on OMERO.web

Postby bhcho » Mon Aug 22, 2011 8:39 pm

Hi,

we have a lot of projects and datasets, and correspondingly a huge number of images on our OMERO server.
Thus, it's extremely slow to display all the projects and datasets from OMERO.web (when you click the "DATA").

Is there anyway to hard-code the containers.html file under /webclient/templates/webclient/data/ or the views.py file under /webclient/ so that I can display only several selective projects by giving project IDs (or by whatever method)?

Best,
BK
bhcho
 
Posts: 236
Joined: Mon Apr 05, 2010 2:15 pm

Re: displaying selective projects on OMERO.web

Postby atarkowska » Tue Aug 23, 2011 9:11 am

Hi BK

In omeroweb/webclient/controller/container.py you can modify the following code:

Code: Select all
def listContainerHierarchy(self, eid=None):
        if eid is not None:
            self.experimenter = self.conn.getExperimenter(eid)
       
        #obj_list = list(self.conn.listContainerHierarchy('Project', eid=eid))
        #obj_list.extend(list(self.conn.listContainerHierarchy('Screen', eid=eid)))
           
        pr_list = list(self.conn.lookupProjects(eid)) <- loads projects
        ds_list = list(self.conn.lookupOrphanedDatasets(eid))  <-loads orphaned datasets
        sc_list = list(self.conn.lookupScreens(eid)) <- loads screens
        pl_list = list(self.conn.lookupOrphanedPlates(eid)) <- load orphaned plates

...


Implementation of "lookup" methods you can find in omeroweb/webclient/webclient_gateway

Thanks
Ola
atarkowska
 
Posts: 327
Joined: Mon May 18, 2009 12:44 pm

Re: displaying selective projects on OMERO.web

Postby bhcho » Tue Aug 23, 2011 3:36 pm

Thanks Ola,

I tried the following code, but it does not seem to work properly.

Code: Select all
def listContainerHierarchy(self, eid=None):
        if eid is not None:
            self.experimenter = self.conn.getExperimenter(eid)
       
        #obj_list = list(self.conn.listContainerHierarchy('Project', eid=eid))
        #obj_list.extend(list(self.conn.listContainerHierarchy('Screen', eid=eid)))
           
        #pr_list = list(self.conn.lookupProjects(eid)) <- loads projects
        pr_list = list(self.conn.listSelectedProjects(long([11, 12, 13, 14, 15])))
        ds_list = list(self.conn.lookupOrphanedDatasets(eid))  <-loads orphaned datasets
        sc_list = list(self.conn.lookupScreens(eid)) <- loads screens
        pl_list = list(self.conn.lookupOrphanedPlates(eid)) <- load orphaned plates
bhcho
 
Posts: 236
Joined: Mon Apr 05, 2010 2:15 pm

Re: displaying selective projects on OMERO.web

Postby jmoore » Thu Aug 25, 2011 1:54 pm

Hi BK,

what do you mean it's not working properly? Are you getting the wrong results? Are you getting an error? Is there something in the log file?

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

Re: displaying selective projects on OMERO.web

Postby bhcho » Thu Aug 25, 2011 3:06 pm

Sorry, I should have explained better.

After I updated the container.py, I only see
Loading imported images... please wait


And this is the last part of OMEROweb-DEBUG.log file
Thu, 25 Aug 2011 15:49:56 omero.util.TempFileManager DEBUG Added file /home/omero/.lock_testZg1_tR.tmp
Thu, 25 Aug 2011 15:49:56 omero.util.TempFileManager DEBUG Chose gloabl tmpdir: /home/omero
Thu, 25 Aug 2011 15:49:56 omero.util.TempFileManager DEBUG Using temp dir: /home/omero/omero/tmp/omero_omero/31399
Thu, 25 Aug 2011 15:49:56 webgateway DEBUG INIT
Thu, 25 Aug 2011 15:49:56 views-admin INFO INIT '31399'
Thu, 25 Aug 2011 15:49:56 views-web INFO INIT '31399'
Thu, 25 Aug 2011 15:49:56 webgateway DEBUG trying stored connection
Thu, 25 Aug 2011 15:49:56 webgateway DEBUG []
Thu, 25 Aug 2011 15:49:56 webgateway DEBUG creating new connection with "S:" (False)
Thu, 25 Aug 2011 15:49:56 blitz_gateway DEBUG Connect attempt, sUuid=1f893708-00b8-4cd5-98f7-0a6af0bf2b5c, group=None, self.sUuid=None
Thu, 25 Aug 2011 15:49:56 blitz_gateway DEBUG connected? False
Thu, 25 Aug 2011 15:49:56 blitz_gateway DEBUG joinSession(1f893708-00b8-4cd5-98f7-0a6af0bf2b5c)
Thu, 25 Aug 2011 15:49:56 blitz_gateway DEBUG ## Creating proxies
Thu, 25 Aug 2011 15:49:56 blitz_gateway INFO created connection (uuid=1f893708-00b8-4cd5-98f7-0a6af0bf2b5c)
Thu, 25 Aug 2011 15:49:56 blitz_gateway DEBUG .. connected!
Thu, 25 Aug 2011 15:49:56 webgateway DEBUG created new connection <webclient.webclient_gateway.OmeroWebGateway object at 0x45bd390>
Thu, 25 Aug 2011 15:49:56 webgateway DEBUG [('S:1f893708-00b8-4cd5-98f7-0a6af0bf2b5c#1', <webclient.webclient_gateway.OmeroWebGateway object at 0x45bd390>)]
Thu, 25 Aug 2011 15:49:56 webgateway DEBUG blitz session key: 1f893708-00b8-4cd5-98f7-0a6af0bf2b5c
Thu, 25 Aug 2011 15:49:56 webgateway DEBUG stored as session.S:1f893708-00b8-4cd5-98f7-0a6af0bf2b5c#1
Thu, 25 Aug 2011 15:49:56 webgateway DEBUG INIT
Thu, 25 Aug 2011 15:50:00 omero.util.TempFileManager DEBUG Added file /home/omero/.lock_test0UOkzU.tmp
Thu, 25 Aug 2011 15:50:00 omero.util.TempFileManager DEBUG Chose gloabl tmpdir: /home/omero
Thu, 25 Aug 2011 15:50:00 omero.util.TempFileManager DEBUG Using temp dir: /home/omero/omero/tmp/omero_omero/31400
Thu, 25 Aug 2011 15:50:00 webgateway DEBUG INIT
Thu, 25 Aug 2011 15:50:00 views-admin INFO INIT '31400'
Thu, 25 Aug 2011 15:50:00 views-web INFO INIT '31400'
Thu, 25 Aug 2011 15:50:00 omero.util.TempFileManager DEBUG Added file /home/omero/.lock_testCb6mG7.tmp
Thu, 25 Aug 2011 15:50:00 omero.util.TempFileManager DEBUG Chose gloabl tmpdir: /home/omero
Thu, 25 Aug 2011 15:50:00 omero.util.TempFileManager DEBUG Using temp dir: /home/omero/omero/tmp/omero_omero/31398
Thu, 25 Aug 2011 15:50:00 omero.util.TempFileManager DEBUG Added file /home/omero/.lock_test0cbUKS.tmp
Thu, 25 Aug 2011 15:50:00 omero.util.TempFileManager DEBUG Chose gloabl tmpdir: /home/omero
Thu, 25 Aug 2011 15:50:00 omero.util.TempFileManager DEBUG Using temp dir: /home/omero/omero/tmp/omero_omero/31397
Thu, 25 Aug 2011 15:50:00 webgateway DEBUG trying stored connection
Thu, 25 Aug 2011 15:50:00 webgateway DEBUG []
Thu, 25 Aug 2011 15:50:00 webgateway DEBUG creating new connection with "S:" (False)
Thu, 25 Aug 2011 15:50:00 blitz_gateway DEBUG Connect attempt, sUuid=1f893708-00b8-4cd5-98f7-0a6af0bf2b5c, group=None, self.sUuid=None
Thu, 25 Aug 2011 15:50:00 blitz_gateway DEBUG connected? False
Thu, 25 Aug 2011 15:50:00 webgateway DEBUG INIT
Thu, 25 Aug 2011 15:50:00 views-admin INFO INIT '31398'
Thu, 25 Aug 2011 15:50:00 views-web INFO INIT '31398'
Thu, 25 Aug 2011 15:50:00 webgateway DEBUG INIT
Thu, 25 Aug 2011 15:50:00 views-admin INFO INIT '31397'
Thu, 25 Aug 2011 15:50:00 views-web INFO INIT '31397'
Thu, 25 Aug 2011 15:50:00 blitz_gateway DEBUG joinSession(1f893708-00b8-4cd5-98f7-0a6af0bf2b5c)
Thu, 25 Aug 2011 15:50:00 blitz_gateway DEBUG ## Creating proxies
Thu, 25 Aug 2011 15:50:00 webgateway DEBUG trying stored connection
Thu, 25 Aug 2011 15:50:00 webgateway DEBUG []
Thu, 25 Aug 2011 15:50:00 webgateway DEBUG creating new connection with "S:" (False)
Thu, 25 Aug 2011 15:50:00 blitz_gateway DEBUG Connect attempt, sUuid=1f893708-00b8-4cd5-98f7-0a6af0bf2b5c, group=None, self.sUuid=None
Thu, 25 Aug 2011 15:50:00 blitz_gateway DEBUG connected? False
Thu, 25 Aug 2011 15:50:00 blitz_gateway INFO created connection (uuid=1f893708-00b8-4cd5-98f7-0a6af0bf2b5c)
Thu, 25 Aug 2011 15:50:00 blitz_gateway DEBUG .. connected!
Thu, 25 Aug 2011 15:50:00 webgateway DEBUG trying stored connection
Thu, 25 Aug 2011 15:50:00 webgateway DEBUG []
Thu, 25 Aug 2011 15:50:00 webgateway DEBUG creating new connection with "S:" (False)
Thu, 25 Aug 2011 15:50:00 blitz_gateway DEBUG Connect attempt, sUuid=1f893708-00b8-4cd5-98f7-0a6af0bf2b5c, group=None, self.sUuid=None
Thu, 25 Aug 2011 15:50:00 blitz_gateway DEBUG connected? False
Thu, 25 Aug 2011 15:50:00 blitz_gateway DEBUG joinSession(1f893708-00b8-4cd5-98f7-0a6af0bf2b5c)
Thu, 25 Aug 2011 15:50:00 blitz_gateway DEBUG ## Creating proxies
Thu, 25 Aug 2011 15:50:00 blitz_gateway INFO created connection (uuid=1f893708-00b8-4cd5-98f7-0a6af0bf2b5c)
Thu, 25 Aug 2011 15:50:00 blitz_gateway DEBUG .. connected!
Thu, 25 Aug 2011 15:50:00 webgateway DEBUG created new connection <webclient.webclient_gateway.OmeroWebGateway object at 0x466f650>
Thu, 25 Aug 2011 15:50:00 webgateway DEBUG [('S:1f893708-00b8-4cd5-98f7-0a6af0bf2b5c#1', <webclient.webclient_gateway.OmeroWebGateway object at 0x466f650>)]
Thu, 25 Aug 2011 15:50:00 webgateway DEBUG blitz session key: 1f893708-00b8-4cd5-98f7-0a6af0bf2b5c
Thu, 25 Aug 2011 15:50:00 webgateway DEBUG stored as session.S:1f893708-00b8-4cd5-98f7-0a6af0bf2b5c#1
Thu, 25 Aug 2011 15:50:00 blitz_gateway DEBUG joinSession(1f893708-00b8-4cd5-98f7-0a6af0bf2b5c)
Thu, 25 Aug 2011 15:50:00 blitz_gateway DEBUG ## Creating proxies
Thu, 25 Aug 2011 15:50:00 webgateway DEBUG created new connection <webclient.webclient_gateway.OmeroWebGateway object at 0x466e650>
Thu, 25 Aug 2011 15:50:00 webgateway DEBUG [('S:1f893708-00b8-4cd5-98f7-0a6af0bf2b5c#1', <webclient.webclient_gateway.OmeroWebGateway object at 0x466e650>)]
Thu, 25 Aug 2011 15:50:00 webgateway DEBUG blitz session key: 1f893708-00b8-4cd5-98f7-0a6af0bf2b5c
Thu, 25 Aug 2011 15:50:00 webgateway DEBUG stored as session.S:1f893708-00b8-4cd5-98f7-0a6af0bf2b5c#1
Thu, 25 Aug 2011 15:50:00 blitz_gateway INFO created connection (uuid=1f893708-00b8-4cd5-98f7-0a6af0bf2b5c)
Thu, 25 Aug 2011 15:50:00 blitz_gateway DEBUG .. connected!
Thu, 25 Aug 2011 15:50:00 webgateway DEBUG created new connection <webclient.webclient_gateway.OmeroWebGateway object at 0x466f650>
Thu, 25 Aug 2011 15:50:00 webgateway DEBUG [('S:1f893708-00b8-4cd5-98f7-0a6af0bf2b5c#1', <webclient.webclient_gateway.OmeroWebGateway object at 0x466f650>)]
Thu, 25 Aug 2011 15:50:00 webgateway DEBUG blitz session key: 1f893708-00b8-4cd5-98f7-0a6af0bf2b5c
Thu, 25 Aug 2011 15:50:00 webgateway DEBUG stored as session.S:1f893708-00b8-4cd5-98f7-0a6af0bf2b5c#1
Thu, 25 Aug 2011 15:50:01 webgateway DEBUG INIT
Thu, 25 Aug 2011 15:50:01 webgateway DEBUG trying stored connection
Thu, 25 Aug 2011 15:50:01 webgateway DEBUG [('S:1f893708-00b8-4cd5-98f7-0a6af0bf2b5c#1', <webclient.webclient_gateway.OmeroWebGateway object at 0x466f650>)]
Thu, 25 Aug 2011 15:50:01 webgateway DEBUG trying stored connection
Thu, 25 Aug 2011 15:50:01 webgateway DEBUG [('S:1f893708-00b8-4cd5-98f7-0a6af0bf2b5c#1', <webclient.webclient_gateway.OmeroWebGateway object at 0x466e650>)]
Thu, 25 Aug 2011 15:50:01 webgateway DEBUG trying stored connection
Thu, 25 Aug 2011 15:50:01 webgateway DEBUG [('S:1f893708-00b8-4cd5-98f7-0a6af0bf2b5c#1', <webclient.webclient_gateway.OmeroWebGateway object at 0x466f650>)]
Thu, 25 Aug 2011 15:50:01 webgateway DEBUG trying stored connection
Thu, 25 Aug 2011 15:50:01 webgateway DEBUG [('S:1f893708-00b8-4cd5-98f7-0a6af0bf2b5c#1', <webclient.webclient_gateway.OmeroWebGateway object at 0x45bd390>)]
Thu, 25 Aug 2011 15:50:01 omero.util.TempFileManager DEBUG Added file /home/omero/.lock_testJJtxqu.tmp
Thu, 25 Aug 2011 15:50:01 omero.util.TempFileManager DEBUG Chose gloabl tmpdir: /home/omero
Thu, 25 Aug 2011 15:50:01 omero.util.TempFileManager DEBUG Using temp dir: /home/omero/omero/tmp/omero_omero/31401
Thu, 25 Aug 2011 15:50:01 webgateway DEBUG INIT
Thu, 25 Aug 2011 15:50:01 views-admin INFO INIT '31401'
Thu, 25 Aug 2011 15:50:01 views-web INFO INIT '31401'
Thu, 25 Aug 2011 15:50:01 webgateway DEBUG trying stored connection
Thu, 25 Aug 2011 15:50:01 webgateway DEBUG []
Thu, 25 Aug 2011 15:50:01 webgateway DEBUG creating new connection with "S:" (False)
Thu, 25 Aug 2011 15:50:01 blitz_gateway DEBUG Connect attempt, sUuid=1f893708-00b8-4cd5-98f7-0a6af0bf2b5c, group=None, self.sUuid=None
Thu, 25 Aug 2011 15:50:01 blitz_gateway DEBUG connected? False
Thu, 25 Aug 2011 15:50:01 webgateway DEBUG trying stored connection
Thu, 25 Aug 2011 15:50:01 webgateway DEBUG [('S:1f893708-00b8-4cd5-98f7-0a6af0bf2b5c#1', <webclient.webclient_gateway.OmeroWebGateway object at 0x466f650>)]
Thu, 25 Aug 2011 15:50:01 webgateway DEBUG trying stored connection
Thu, 25 Aug 2011 15:50:01 webgateway DEBUG [('S:1f893708-00b8-4cd5-98f7-0a6af0bf2b5c#1', <webclient.webclient_gateway.OmeroWebGateway object at 0x466e650>)]
Thu, 25 Aug 2011 15:50:01 blitz_gateway DEBUG joinSession(1f893708-00b8-4cd5-98f7-0a6af0bf2b5c)
Thu, 25 Aug 2011 15:50:01 blitz_gateway DEBUG ## Creating proxies
Thu, 25 Aug 2011 15:50:01 webgateway DEBUG trying stored connection
Thu, 25 Aug 2011 15:50:01 webgateway DEBUG [('S:1f893708-00b8-4cd5-98f7-0a6af0bf2b5c#1', <webclient.webclient_gateway.OmeroWebGateway object at 0x466f650>)]
Thu, 25 Aug 2011 15:50:01 webgateway DEBUG trying stored connection
Thu, 25 Aug 2011 15:50:01 webgateway DEBUG [('S:1f893708-00b8-4cd5-98f7-0a6af0bf2b5c#1', <webclient.webclient_gateway.OmeroWebGateway object at 0x45bd390>)]
Thu, 25 Aug 2011 15:50:02 webgateway DEBUG trying stored connection
Thu, 25 Aug 2011 15:50:02 webgateway DEBUG [('S:1f893708-00b8-4cd5-98f7-0a6af0bf2b5c#1', <webclient.webclient_gateway.OmeroWebGateway object at 0x466f650>)]
Thu, 25 Aug 2011 15:50:02 blitz_gateway INFO created connection (uuid=1f893708-00b8-4cd5-98f7-0a6af0bf2b5c)
Thu, 25 Aug 2011 15:50:02 blitz_gateway DEBUG .. connected!
Thu, 25 Aug 2011 15:50:02 webgateway DEBUG created new connection <webclient.webclient_gateway.OmeroWebGateway object at 0x46705d0>
Thu, 25 Aug 2011 15:50:02 webgateway DEBUG [('S:1f893708-00b8-4cd5-98f7-0a6af0bf2b5c#1', <webclient.webclient_gateway.OmeroWebGateway object at 0x46705d0>)]
Thu, 25 Aug 2011 15:50:02 webgateway DEBUG blitz session key: 1f893708-00b8-4cd5-98f7-0a6af0bf2b5c
Thu, 25 Aug 2011 15:50:02 webgateway DEBUG stored as session.S:1f893708-00b8-4cd5-98f7-0a6af0bf2b5c#1
Thu, 25 Aug 2011 15:50:02 webgateway DEBUG trying stored connection
Thu, 25 Aug 2011 15:50:02 webgateway DEBUG [('S:1f893708-00b8-4cd5-98f7-0a6af0bf2b5c#1', <webclient.webclient_gateway.OmeroWebGateway object at 0x466f650>)]
Thu, 25 Aug 2011 15:50:37 webgateway DEBUG trying stored connection
Thu, 25 Aug 2011 15:50:37 webgateway DEBUG [('S:1f893708-00b8-4cd5-98f7-0a6af0bf2b5c#1', <webclient.webclient_gateway.OmeroWebGateway object at 0x46705d0>)]
Thu, 25 Aug 2011 15:50:38 webgateway DEBUG INIT
Thu, 25 Aug 2011 15:50:38 views-web DEBUG TEMPLATE: webclient/data/containers.html
Thu, 25 Aug 2011 15:50:38 webgateway DEBUG trying stored connection
Thu, 25 Aug 2011 15:50:38 webgateway DEBUG [('S:1f893708-00b8-4cd5-98f7-0a6af0bf2b5c#1', <webclient.webclient_gateway.OmeroWebGateway object at 0x466f650>)]
Thu, 25 Aug 2011 15:50:40 webgateway DEBUG trying stored connection
Thu, 25 Aug 2011 15:50:40 webgateway DEBUG [('S:1f893708-00b8-4cd5-98f7-0a6af0bf2b5c#1', <webclient.webclient_gateway.OmeroWebGateway object at 0x45bd390>)]
bhcho
 
Posts: 236
Joined: Mon Apr 05, 2010 2:15 pm

Re: displaying selective projects on OMERO.web

Postby jmoore » Thu Aug 25, 2011 3:36 pm

BK,

thanks for the logs. Ola's away just now, but she'll look into it when she gets back. In the meantime, you might try adding your own debugging statements to see if the new method is returning anything at all.

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

Re: displaying selective projects on OMERO.web

Postby bhcho » Thu Aug 25, 2011 3:52 pm

Thanks Josh,

It's interesting to add my own statement. Could you tell me how to do that?

BK
bhcho
 
Posts: 236
Joined: Mon Apr 05, 2010 2:15 pm

Re: displaying selective projects on OMERO.web

Postby jmoore » Thu Aug 25, 2011 4:09 pm

Something like this should work:
Code: Select all
~/git $ git grep -i log components/tools/OmeroWeb/omeroweb/webclient/controller/
components/tools/OmeroWeb/omeroweb/webclient/controller/container.py:import logging
components/tools/OmeroWeb/omeroweb/webclient/controller/container.py:logger = logging.getLogger('web-container')


If you use a different log name like getLogger('web-searcher') then you should be able to grep for your results.

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

Re: displaying selective projects on OMERO.web

Postby bhcho » Thu Aug 25, 2011 5:37 pm

Thanks Josh,

I just realized that I have a syntax error from the previous code. (Booooo~~~~~ to myself)
Now, It works with the following code. (i can display only 5 projects)
Code: Select all
pr_list = list(self.conn.listSelectedProjects([11, 12, 13, 14, 15]))


Best,
BK
bhcho
 
Posts: 236
Joined: Mon Apr 05, 2010 2:15 pm


Return to Developer Discussion

Who is online

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