diff --git a/agent/README.txt b/agent/README.txt index 5b32e0a..fbd1ef7 100644 --- a/agent/README.txt +++ b/agent/README.txt @@ -258,10 +258,11 @@ Format/Information structure ---------------------------- - Metadata URL (for storing or accessing metadata sets - optional, see below): - ``$loopsSiteURL/resource_meta/$machine_name/$user/$service/$path.xml`` + ``$loopsSiteURL/resource_meta/$machine_name/$user/$app/$path.xml`` - Resource URL (for storing or accessing the real resources): - ``$loopsSiteURL/resource_data/$machine_name//$user/$service/$path`` -- ``$service`` names the crawler service, e.g. "filesystem" or "outlook" + ``$loopsSiteURL/resource_data/$machine_name//$user/$app/$path`` +- ``$app`` names the type of application providing the resource, e.g. + "filesystem" or "mail" - ``$path`` represents the full path, possibly with drive specification in front (for filesystem resources on Windows), with special characters URL-escaped diff --git a/agent/interfaces.py b/agent/interfaces.py index 5b240b9..cdeae3f 100644 --- a/agent/interfaces.py +++ b/agent/interfaces.py @@ -117,7 +117,7 @@ class IResource(Interface): 'uniquely identifying the resource on the client ' 'machine for the current user.') application = Attribute('The name of the application that provided ' - 'the resource.') + 'the resource, e.g. "filesystem" or "mail".') metadata = Attribute('Information describing this resource; ' 'should be an IMetadataSet object.') diff --git a/agent/transport/base.py b/agent/transport/base.py index 0099c81..c86e654 100644 --- a/agent/transport/base.py +++ b/agent/transport/base.py @@ -85,13 +85,16 @@ class Transporter(object): deferreds = [] metadata = resource.metadata if metadata is not None: - url = self.makePath('meta', app, path) + url = self.makePath('meta', app, path, 'xml') deferreds.append( getPage(url, method=self.method, postData=metadata.asXML())) url = self.makePath('data', app, path) deferreds.append(getPage(url, method=self.method, postData=text)) return DeferredList(deferreds) - def makePath(self, infoType, app, path): - return '/'.join((self.serverURL, infoType, app, path)) + def makePath(self, infoType, app, path, extension=None): + fullPath = '/'.join((self.serverURL, infoType, app, path)) + if extension: + fullPath += '.' + extension + return fullPath