> Ok, I figured it out. It appears that the path to the service is not
> really set in "service.xml" but by the following lines in
> application.py (circa line 97)
> # Mount the blog AtomPub web service
> c = self.servdoc.get_collection_by_uri('http://localhost:8080/
> service/blog/')
> self.service.blog = CollectionHandler(c)
> self.service.blog.paging = CollectionPagingHandler(c)
> So "self.service.blog" is what determines the path. So when you
> request as follows:
>>>> r, c = h.request('http://localhost:8080/path/to/myservice/')
> it doesn't matter what you specified in service.xml as long as the
> commands in application.py are as follows:
> # Mount the blog AtomPub web service
> c = self.servdoc.get_collection_by_uri('http://localhost:8080/
> whatever/you/put/in/xml/file/')
> self.path.to.my.service = CollectionHandler(c)
> self.path.to.my.serivce = CollectionPagingHandler(c)
> Igor.
> On Apr 4, 4:40 pm, IP <ipesen...@gmail.com> wrote:
>> Hi,
>> After much effort I was able to get amplee running with dejavu using
>> mysql. To make sure I understand how a service is set up I tried to
>> add a service and repeat the tutorial. I'm not certain I have the
>> terminology correct - in the xml service document vocabulary I guess
>> I'm trying to add a collection (and workspace I think as well).
>> The basic question is - what are the steps to create or add a service
>> to amplee? As far as I understand I need to define a new workspace in
>> service.xml and explicitly mount the service in application.py. If I
>> want the same behavior as in the amplee tutorial I don't need to
>> change anything else. What am I missing?
>> It does not seem to work as above. I modify the service.xml file of
>> the tutorial so that it looks like the following. I just tacked on a
>> second collection called "FeedFeed" below the given one.
>> <?xml version="1.0" encoding="UTF-8"?>
>> <app:service xmlns:atom="http://www.w3.org/2005/Atom"
>> xmlns:app="http://www.w3.org/2007/app" xml:lang="en" xml:base="http://
>> localhost:8080/">
>> <app:workspace>
>> <atom:title type="text">Blog</atom:title>
>> <app:collection href="service/blog/">
>> <atom:title type="text">My blog and related thoughts</
>> atom:title>
>> <!-- public URI of the blog -->
>> <atom:link href="blog/" type="application/atom+xml;type=feed"
>> rel="alternate"/>
>> <app:accept>application/atom+xml;type=entry</app:accept>
>> <app:accept>image/png</app:accept>
>> <app:accept>application/x-www-form-urlencoded</app:accept>
>> <app:categories>
>> <atom:category term="me" scheme="http://people.net" label="Me me me" /
>> </app:categories>
>> </app:collection>
>> </app:workspace>
>> <app:workspace>
>> <atom:title type="text">FeedFeed</atom:title>
>> <app:collection href="service/feedfeed/">
>> <atom:title type="text">FeedFeed service</atom:title>
>> <!-- public URI of the blog -->
>> <atom:link href="feedfeed/" type="application/atom
>> +xml;type=feed" rel="alternate"/>
>> <app:accept>application/atom+xml;type=entry</app:accept>
>> <app:accept>image/png</app:accept>
>> <app:accept>application/x-www-form-urlencoded</app:accept>
>> <app:categories>
>> <atom:category term="ff" scheme="http://feedfeed.net"
>> label="Feed food ff" />
>> </app:categories>
>> </app:collection>
>> </app:workspace>
>> </app:service>
>> I then update "create_serving_applications" in application.py so that
>> the function looks like so:
>> def create_serving_applications(self):
>> self.service =
>> ServiceHandler(self.servdoc.to_service().xml(indent=True))
>> # Mount the blog AtomPub web service
>> c = self.servdoc.get_collection_by_uri('http://localhost:8080/
>> service/blog/')
>> self.service.blog = CollectionHandler(c)
>> self.service.blog.paging = CollectionPagingHandler(c)
>> # Mount the FeedFeed web service
>> c = self.servdoc.get_collection_by_uri('http://localhost:8080/
>> service/feedfeed/')
>> self.service.ff = CollectionHandler(c)
>> self.service.ff.paging = CollectionPagingHandler(c)
>> The service starts and I can interact with the blog collection as in
>> the tutorial. When I try to get the new collection
>> r, c = h.request('http://localhost:8080/service/feedfeed/')
>> I get a server error and the traceback is
>> File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
>> python2.5/site-packages/CherryPy-3.1.0beta3-py2.5.egg/cherrypy/
>> _cprequest.py", line 588, in respond
>> cherrypy.response.body = self.handler()
>> File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
>> python2.5/site-packages/CherryPy-3.1.0beta3-py2.5.egg/cherrypy/
>> _cpdispatch.py", line 24, in __call__
>> return self.callable(*self.args, **self.kwargs)
>> TypeError: GET() takes exactly 1 argument (2 given)
>> Any hints much appreciated. Once I figure this out I'll be trying to
>> modify the behavior of the http calls to the collections - I'm
>> guessing that's where the real fun will begin. Thanks ahead of
>> time!
>> Igor.