Thanks very much for your tips and examples, it is very valuable. Thanks a lot. On the server side I want to be server neutral, and use what ever resource is there: Apache, FTP. And may be I don't want to build a specific Smalltalk server, at least for now. Is it possible to use FTP client in Pharo? Hilaire Le 03/12/2011 11:45, Sven Van Caekenberghe a écrit :
Hilaire,
On 03 Dec 2011, at 10:38, Hilaire Fernandes wrote:
Hello,
In DrGeo I want a new feature: users could save and load sketches in a remote server. It could be done with FTP or HTTP, or any other means. I don't have any experience in networked operation nor what it is possible to do with the Pharo classes library.
What are your suggestion?
Thanks
Hilaire
I would use HTTP with basic authentication to start with, like Monticello does today. Account management is a seperate problem, as is some security strategy. You probably intent to have sharing, so you have to think about that too.
The client side could be very simple (for simplicity let's assume you store strings, you could pick a better representation with automatic encoding/decoding, later on):
"Get drawing1"
ZnClient new username: 'john' password: 'secret'; get: 'http://www.drgeo.eu/drawings/johnsbook/drawing1'.
"Store a new drawing or overwrite an existing one"
ZnClient new username: 'john' password: 'secret'; contents: 'a string representation of a drawing'; put: 'http://www.drgeo.eu/drawings/johnsbook/drawing1'.
"Delete a drawing"
ZnClient new username: 'john' password: 'secret'; delete: 'http://www.drgeo.eu/drawings/johnsbook/drawing1'.
"List my drawings"
ZnClient new username: 'john' password: 'secret'; get: 'http://www.drgeo.eu/drawings/johnsbook/'.
The server side would not be that much work either: have a look at how the ZnMonticelloServerDelegate class (to be combined with a ZnServer). This implements a comparable protocol.
HTH,
Sven
-- Dr. Geo -- http://www.drgeo.eu