Checked items now work

This address issue #118.  The download and delete actions work as expected.  Internally, there are two new endpoints: resource/download GET and resource DELETE.  The download can actually get item, folder, user, and collection resources, and the delete can work on any model that has a remove method.
Since resource DELETE will work on any kind of resource, the total progress
is probably the sum of the items for all of the listed resources.  For
users and collections, this would be a sum of the subtree counts of each
top level folder.  In general, we would need an abstract elementCount
method for the different models (which would be 1 in the model_base, and
overridden in folders, users, and collections), and we would have to sum
this up on all requested resources to know what the total progress would be
as we start.

Alternately, to avoid iterating through the specified resources twice, we
could have the total number of things to delete change as we go (start it
at the number of specified resources, and change it when we get to a folder
to reflect the new knowledge).

Thoughts?

On Tue, Oct 14, 2014 at 9:09 PM, Zach Mullen <notifications@github.com>
wrote:

> In girder/api/v1/resource.py:
>
> > +               'archive.', required=False, dataType='boolean')
> > +        .errorResponse('Unsupport or unknown resource type.')
> > +        .errorResponse('Invalid resources format.')
> > +        .errorResponse('No resources specified.')
> > +        .errorResponse('Resource not found.')
> > +        .errorResponse('Read access was denied for a resource.', 403))
> > +
> > +    @access.user
> > +    def delete(self, params):
> > +        """
> > +        Delete a set of resources.
> > +        """
> > +        user = self.getCurrentUser()
> > +        resources = self._validateResourceSet(params, 'remove', user,
> > +                                              AccessType.ADMIN)
> > +        count = sum([len(resources[key]) for key in resources])
>
> I think we need special handling here for folders. If progress=true, we
> should count their size recursively just like we do for the folder deletion
> endpoint rather than just counting each one as the same value. If progress
> is false, we don't need to count anything.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/girder/girder/pull/398/files#r18870239>.
>