import QtQuick 2.0 import QtQuick.XmlListModel 2.0 //http://s3.amazonaws.com/hifi-public?prefix=models/attachments /* models/attachments/guitar.fst 2015-11-10T00:28:22.000Z "236c00c4802ba9c2605cabd5601d138e" 2992 STANDARD */ // FIXME how to deal with truncated results? Store the marker? XmlListModel { id: xmlModel property string prefix: "models/attachments/" property string extension: "fst" property string filter; readonly property string realPrefix: prefix.match('.*/$') ? prefix : (prefix + "/") readonly property string nameRegex: realPrefix + (filter ? (".*" + filter) : "") + ".*\." + extension readonly property string nameQuery: "Key/substring-before(substring-after(string(), '" + prefix + "'), '." + extension + "')" readonly property string baseUrl: "http://s3.amazonaws.com/hifi-public" // FIXME need to urlencode prefix? source: baseUrl + "?prefix=" + realPrefix query: "/ListBucketResult/Contents[matches(Key, '" + nameRegex + "')]" namespaceDeclarations: "declare default element namespace 'http://s3.amazonaws.com/doc/2006-03-01/';" XmlRole { name: "name"; query: nameQuery } XmlRole { name: "size"; query: "Size/string()" } XmlRole { name: "tag"; query: "ETag/string()" } XmlRole { name: "modified"; query: "LastModified/string()" } XmlRole { name: "key"; query: "Key/string()" } }