We're Hiring!

spaces in paths/project names gives empty project?

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.

spaces in paths/project names gives empty project?

Postby jwarren » Mon Sep 08, 2014 4:22 pm

Hi

My script upload images to omero and before doing so checks based on the location from where the image was uploaded if the image is already in omero - this code does find images for a project name that has spaces in it and returns an omero_id:
Code: Select all
print "\nList Projects:"
    print "=" * 50
    my_expId = conn.getUser().getId()
    for project in conn.listProjects(my_expId):
        print_obj(project)
        for dataset in project.listChildren():
            print_obj(dataset, 2)
            for image in dataset.listChildren():
                #print_obj(image, 4)
                fileset = image.getFileset()
                print 'fileset=', fileset
                if fileset is not None:
                    print 'image id=', image.getId()
                    filesetId=fileset.getId()
                    query = 'SELECT clientPath FROM FilesetEntry WHERE fileset.id = :id'
                    params = omero.sys.ParametersI()
                    params.addId(omero.rtypes.rlong(filesetId))
                    for path in conn.getQueryService().projection(query, params):
                        fullPath=path[0].val
                        if splitString in fullPath:
                            print 'path in omero=' +fullPath
                            relativeOmeroUrl=fullPath.split(splitString,1)[1]
                            print "adding to hash relative omero url="+relativeOmeroUrl
                            alreadyInOmero.add(relativeOmeroUrl)


However when I look in omero using either the web client or the insight client the project is empty?
So i'm guessing this is a client issue?? is the answer just not use any paths/project names with a space in them?

Cheers :)

Jonathan.
jwarren
 
Posts: 102
Joined: Wed Jul 09, 2014 1:35 pm

Re: spaces in paths/project names gives empty project?

Postby bramalingam » Tue Sep 09, 2014 1:17 pm

Hi Jonathan,

Thank you for reporting your bug.

Can you please check if the project ID printed from your script and the project ID shown in the clients are matching?

The script looks fine, if the bug is related to spaces in the project names, then please try the following,
(I doubt this will work)

Remove the spaces from the (project) name and refresh the tree. If this solves the case and shows the datasets, then the bug is definitely related to the spaces in the name.

If this doesn't solve the case, then you might have check your upload script for potential bugs (on how you link the images to the dataset/project).

It would also help if you could give us the following details,if the issue persists :

1) What version of OMERO server and client are you using?
2) Paste the results of the your script.
3) Can you try creating a Project manually via the clients (with spaces in the name) and upload images? Does this throw a bug?
-- This should work.
4) Compare results between manual upload (as suggested above) and the troublesome case reported in your query.

Best,
Balaji
User avatar
bramalingam
 
Posts: 70
Joined: Tue Jan 14, 2014 12:01 pm


Return to Developer Discussion

Who is online

Users browsing this forum: No registered users and 1 guest