'index( self, trans, history_id, **kwd )
* GET /api/histories/{history_id}/contents
return a list of HDA data for the history with the given ``id``
.. note:: Anonymous users are allowed to get their current history contents
If ids is given, index returns a *more complete* json object for each
HDA in the ids list.
:type   history_id: str
:param  history_id: encoded id string of the HDA\'s History
:rtype:     list
:returns:   dictionaries containing summary or detailed HDA information
The following are optional parameters:
view:   string, one of (\'summary\',\'detailed\'), defaults to \'summary\'
controls which set of properties to return
keys:   comma separated strings, unused by default
keys/names of individual properties to return
If neither keys or views are sent, the default view (set of keys) is returned.
If both a view and keys are sent, the key list and the view\'s keys are
combined.
If keys are sent and no view, only those properties in keys are returned.
For which properties are available see:
galaxy/managers/hdas/HDASerializer
and:
galaxy/managers/collection_util
The list returned can be filtered by using two optional parameters:
q:      string, generally a property name to filter by followed
by an (often optional) hyphen and operator string.
qv:     string, the value to filter by
..example:
To filter the list to only those created after 2015-01-29,
the query string would look like:
\'?q=create_time-gt&qv=2015-01-29\'
Multiple filters can be sent in using multiple q/qv pairs:
\'?q=create_time-gt&qv=2015-01-29&q=name-contains&qv=experiment-1\'
The list returned can be paginated using two optional parameters:
limit:  integer, defaults to no value and no limit (return all)
how many items to return
offset: integer, defaults to 0 and starts at the beginning
skip the first ( offset - 1 ) items and begin returning
at the Nth item
..example:
limit and offset can be combined. Skip the first two and return five:
\'?limit=5&offset=3\'
The list returned can be ordered using the optional parameter:
order:  string containing one of the valid ordering attributes followed
(optionally) by \'-asc\' or \'-dsc\' for ascending and descending
order respectively. Orders can be stacked as a comma-
separated list of values.
..example:
To sort by name descending then create time descending:
\'?order=name-dsc,create_time\'
The ordering attributes and their default orders are:
hid defaults to \'hid-asc\'
create_time defaults to \'create_time-dsc\'
update_time defaults to \'update_time-dsc\'
name    defaults to \'name-asc\'
\'order\' defaults to \'hid-asc\''

def __index_v2(self, trans, history_id, **kwd):

    rval = []
    history = self.history_manager.get_accessible(self.decode_id(history_id), trans.user, current_history=trans.history)
    filter_params = self.parse_filter_params(kwd)
    filters = self.history_contents_filters.parse_filters(filter_params)
    (limit, offset) = self.parse_limit_offset(kwd)
    order_by = self._parse_order_by(kwd.get('order', 'hid-asc'))
    serialization_params = self._parse_serialization_params(kwd, 'summary')
    details = kwd.get('details', [])
    if (details and (details != 'all')):
        details = util.listify(details)
    view = serialization_params.pop('view')
    contents = self.history_contents_manager.contents(history, filters=filters, limit=limit, offset=offset, order_by=order_by)
    for content in contents:
        if isinstance(content, trans.app.model.HistoryDatasetAssociation):
            if ((details == 'all') or (trans.security.encode_id(content.id) in details)):
                rval.append(self.hda_serializer.serialize_to_view(content, user=trans.user, trans=trans, view='detailed', **serialization_params))
            else:
                rval.append(self.hda_serializer.serialize_to_view(content, user=trans.user, trans=trans, view=view, **serialization_params))
        elif isinstance(content, trans.app.model.HistoryDatasetCollectionAssociation):
            collection = self.hdca_serializer.serialize_to_view(content, user=trans.user, trans=trans, view=view, **serialization_params)
            rval.append(collection)
    return rval
