make interfaces, README, transport conform to each other
git-svn-id: svn://svn.cy55.de/Zope3/src/loops/trunk@1904 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
parent
e140e0eccc
commit
2f81551c2a
3 changed files with 11 additions and 7 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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.')
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue