Page 1 of 1

how to start to add to new feature to omero as web app

PostPosted: Tue Aug 08, 2017 7:49 am
by saleht
Hi all,

i am here again :D, so i am now try to understand some stuff in OMERO because my users need some changes or additional things to be done tin OMERO

first question do i can re-using omero commands in my code in scripts etc...
as a small example for test things i wrote a bach script( just 1 line :D)
to check if i can reuse Omero commands but it did not work
Code: Select all
#!/bin/bash
su - omero  /home/omero/OMERO.server/bin/omero login;

i got something like this
Code: Select all
$'\n\n:author: Josh Moore <josh@glencoesoftware.com>\n\nPython driver for OMERO\nCopyright (c) 2007, Glencoe Software, Inc.\nSee LICENSE for details.\n\n': command not found


- in which level OMERO command in Background works ( python or java or ice) ?

- where can i find the the source of omero command ?

- if there are some links which i can have more info about deep technical things in Omero

- web apps like Omero figure doest use models to speak with DB because models files is empty,
he use omero server as broker or how ?

i am little confused how to start, but what i know that i want to do everything throw web apps, because you will drop omero.insight in future

i already read about Django, how u used and how it works it is pretty cool, but i need now some more info


thx a lot and be patient with me pls :D

Regards, Saleh

Re: how to start to add to new feature to omero as web app

PostPosted: Tue Aug 08, 2017 10:22 am
by jmoore
saleht wrote:Hi all,


Hi Saleh,

first question do i can re-using omero commands in my code in scripts etc...
as a small example for test things i wrote a bach script( just 1 line :D)
to check if i can reuse Omero commands but it did not work
Code: Select all
#!/bin/bash
su - omero  /home/omero/OMERO.server/bin/omero login;



That second line needs to be:

Code: Select all
su - omero -c "..."



- in which level OMERO command in Background works ( python or java or ice) ?


Which background commands? Are you referring to scripts?

- where can i find the the source of omero command ?


Do you mean https://github.com/openmicroscopy/openmicroscopy/blob/develop/components/tools/OmeroPy/bin/omero?

- if there are some links which i can have more info about deep technical things in Omero


Perhaps https://docs.openmicroscopy.org/omero/5.3.3/developers/index.html would be a good starting point? It depends on what you're looking for though.

- web apps like Omero figure doest use models to speak with DB because models files is empty,
he use omero server as broker or how ?


OMERO.figure stores a json file attached in OMERO:

https://github.com/ome/omero-figure/blob/master/omero_figure/views.py#L174

i am little confused how to start, but what i know that i want to do everything throw web apps, because you will drop omero.insight in future


Yes. We'd suggest starting by writing web apps for any new functionality you need at this point. If you can describe what you are trying to achieve, we may be able to point you to further examples.

Cheers.
~Josh.

Re: how to start to add to new feature to omero as web app

PostPosted: Wed Aug 09, 2017 8:05 am
by saleht
Hi Josh,

thank you for your support :), i am so happy to be a member in this community which has collaboration is important value for all :).

su - omero -c "..."

this is worked ;)

i am trying to do this in python, in my omero test server

>>>from omero.gateway import BlitzGateway
>>>conn = BlitzGateway(x, y, host=localhost, port=4080)

x: is my omero username
y: is the password for x

but i am getting the user is not defined
is 4080 as port is right ?

i i wanted to use run the following script, where should i store my (username, pass, host, port) info
https://github.com/openmicroscopy/openm ... o_OMERO.py

Yes. We'd suggest starting by writing web apps for any new functionality you need at this point. If you can describe what you are trying to achieve, we may be able to point you to further examples.



i am still in discovering phase of Environment, when i have a full picture of requirements , i will tell you

Cheers,
Saleh

Re: how to start to add to new feature to omero as web app

PostPosted: Wed Aug 09, 2017 8:34 am
by saleht
Hi Josh,
conn = BlitzGateway(x, y, host=localhost, port=4080)


it works now :),
i was using wrong port :). so pls ignore my last post

Re: how to start to add to new feature to omero as web app

PostPosted: Wed Aug 09, 2017 9:00 am
by wmoore
Hi Salah,

The code for the omero command line tool is under
https://github.com/openmicroscopy/openm ... ro/plugins with each .py file corresponding to each command.

E.g.
Code: Select all
$ bin/omero web start


is handled by
Code: Select all
def start()
in web.py: https://github.com/openmicroscopy/openm ... eb.py#L509


None of the web apps use the Django models since we don't use Django to talk to any DB. It is really just a Python OMERO client, saving everything to OMERO via the OMERO Python API using the BlitzGateway.
See https://docs.openmicroscopy.org/omero/5 ... s/Web.html for getting started with Web apps.

Re: how to start to add to new feature to omero as web app

PostPosted: Wed Aug 09, 2017 1:11 pm
by jmoore
saleht wrote:Hi Josh,


Hi Saleh,

thank you for your support :), i am so happy to be a member in this community which has collaboration is important value for all :).


Glad to have you part of it! :)

but i am getting the user is not defined
is 4080 as port is right ?


No. 4080 is the port that Django is listening on. In production, nothing other than nginx should access 4080 directly. If you are using the web API, you would then access the port of nginx (80, 443, or similar).

For accessing the Ice API, however, you want to use port 4064 (and 4063 if you drop SSL).

i am still in discovering phase of Environment, when i have a full picture of requirements , i will tell you


Understood.
~Josh.