Page 1 of 1

displaying selective projects on OMERO.web

PostPosted: Mon Aug 22, 2011 8:39 pm
by bhcho
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

Re: displaying selective projects on OMERO.web

PostPosted: Tue Aug 23, 2011 9:11 am
by atarkowska
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

Re: displaying selective projects on OMERO.web

PostPosted: Tue Aug 23, 2011 3:36 pm
by bhcho
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

Re: displaying selective projects on OMERO.web

PostPosted: Thu Aug 25, 2011 1:54 pm
by jmoore
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.

Re: displaying selective projects on OMERO.web

PostPosted: Thu Aug 25, 2011 3:06 pm
by bhcho
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>)]

Re: displaying selective projects on OMERO.web

PostPosted: Thu Aug 25, 2011 3:36 pm
by jmoore
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

Re: displaying selective projects on OMERO.web

PostPosted: Thu Aug 25, 2011 3:52 pm
by bhcho
Thanks Josh,

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

BK

Re: displaying selective projects on OMERO.web

PostPosted: Thu Aug 25, 2011 4:09 pm
by jmoore
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.

Re: displaying selective projects on OMERO.web

PostPosted: Thu Aug 25, 2011 5:37 pm
by bhcho
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