Notice: In order to edit this ticket you need to be either: a Product Owner, The owner or the reporter of the ticket, or, in case of a Task not yet assigned, a team_member"

Task #7301 (closed)

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

Bug: gateway does not support deleting originalfiles, etc.

Reported by: jamoore Owned by: cxallan
Priority: major Milestone: OMERO-4.4
Component: API Version: n.a.
Keywords: n.a. Cc: python-team@…, jburel
Resources: n.a. Referenced By: n.a.
References: n.a. Remaining Time: 0.0d
Sprint: 2012-01-17 (6)

Description

If we want the gateway to be the one entry point, then we'll need to support more types then these.

~/git/dist/lib/python $ python ../../alex.py 
[[901L]]
Traceback (most recent call last):
  File "../../alex.py", line 27, in <module>
    handle = g.deleteObjects("/OriginalFile", file_ids, deleteAnns=True)
  File "/Users/moore/GlencoeSoftware.git/git/omero.git/dist/lib/python/omero/gateway/__init__.py", line 2852, in deleteObjects
    raise AttributeError(m)
AttributeError: /Originalfile is not an object type. Must be: Project, Dataset, Image, Screen, Plate, Well, Annotation

See #7300

Change History (12)

comment:1 Changed 8 years ago by wmoore

Where is the defined list of what types the delete service supports?

comment:2 Changed 8 years ago by jmoore

It's defined in server/resources/ome/services/delete/spec.xml and can be retrieved via the API with deleteServicePrx.availableCommands().

comment:3 Changed 8 years ago by jburel

When deleting the archived image, the archived flag of image must be set to false

comment:4 Changed 8 years ago by cxallan

  • Owner set to cxallan
  • Sprint set to 2012-01-17 (6)
  • Status changed from new to accepted

comment:5 Changed 8 years ago by cxallan

  • Remaining Time set to 0.5

comment:6 Changed 8 years ago by cxallan

  • Remaining Time changed from 0.5 to 0.25

Initial implementation which makes deleteObjects() generic is available on my GitHub branch:
https://github.com/chris-allan/openmicroscopy/tree/7301_delete_ofile

comment:7 Changed 8 years ago by jmoore

Some thoughts which we might want to take into account as a part of a larger story:

  • "graphspec" rather than "delspec": In my 3532-chgrp branch, the delete spec's have been completely refactored to be delete-independent and are now called "graph specs". As always, open to suggestions, but since we will probably be using these in more places (export, etc) it'd make sense to unify the nomenclature. But since that's not present in develop yet, it could certainly wait.
  • new graph api: Similarly in that branch, the delete APIs has been used as the basis for a generalized async API which can also work with other graphs, which prevents us from having to have a new API per async action. Migrating to that would be useful.
  • multiple uses of delete object: In at least one place, IUpdate.deleteObject is being using with tx-safety. Soonish would be a good time to migrate them. (If we need more specs to make that happen, that's fine). For example:
        def removeAnnotations (self, ns):
            """
            Uses updateService to delete annotations, with specified ns, and their links on the object
            
            @param ns:      Namespace
            @type ns:       String
            """
            for al in self._getAnnotationLinks(ns=ns):
                a = al.child
                update = self._conn.getUpdateService()
                update.deleteObject(al)
                update.deleteObject(a)
            self._obj.unloadAnnotationLinks()        
    

comment:8 Changed 8 years ago by cxallan

  • Remaining Time changed from 0.25 to 0
  • Resolution set to fixed
  • Status changed from accepted to closed

All understood Josh. I've made the nomenclature changes so that they are more generic and in line with the incoming branches and #7772 has been created to attempt to address the non-transactional uses of deleteObject(). Closing as now a pull request has been opened:

comment:9 Changed 8 years ago by Chris Allan <callan@…>

(In [cd602078226157a2d7af2ea7bc29b3a0e16f2e8a/ome.git] on branch develop) BlitzGateway? deleteObjects() overhaul. (Fixes #7301)

This completely overhauls the deleteObjects() method of BlitzGateway?,
making it more generic and switching to the use of delete specifications
rather than object names. This makes the user have to prefix their
object with a '/' but also teaches them that delete via this mechanism
is more than just deleting an object. The previous object type style is
preserved albeit with deprecation warnings. Furthermore the use of
.title() on the object type has been removed, ensuring that delete
specifications that use mixed case, like '/OriginalFile?', do not break.

comment:10 Changed 8 years ago by jmoore <josh@…>

(In [b4a39b7f9b39dfa911427d58f3304cb2dd0704ff/ome.git] on branch develop) Add support for annotation link delete (See #7301)

comment:11 Changed 8 years ago by jmoore <josh@…>

(In [384b4d88b1696b1be1b580fd48a496ded14d31b3/ome.git] on branch develop) Refactor unlinkAnnotations to use a single transaction (Fix #7301)

comment:12 Changed 8 years ago by Josh Moore <josh.moore@…>

(In [ecb0ab20019cec7e49ac704c540836d768133a9d/ome.git] on branch develop) Merge pull request #63 from chris-allan/7301_delete_ofile

See #7301. Move deleteObjects, removeAnnotations, and unlinkAnnotations to the use of new-style delete, each within a single transaction.

Note: See TracTickets for help on using tickets. You may also have a look at Agilo extensions to the ticket.

1.3.13-PRO © 2008-2011 Agilo Software all rights reserved (this page was served in: 0.95113 sec.)

We're Hiring!