Page 1 of 1

spaces in paths/project names gives empty project?

PostPosted: Mon Sep 08, 2014 4:22 pm
by jwarren
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.

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

PostPosted: Tue Sep 09, 2014 1:17 pm
by bramalingam
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