Difference between revisions of "Features/Transfer to many options"

From Sugar Labs
Jump to: navigation, search
([ALTERNATE WORKFLOW, Client] Tries to load the listview, for the locally-mounted remote share.)
Line 238: Line 238:
 
== [Client] Server-1's Turtle-Art entry, successfully replicated at client. ==
 
== [Client] Server-1's Turtle-Art entry, successfully replicated at client. ==
 
:[[File:C11.png|640px]]
 
:[[File:C11.png|640px]]
 +
 +
 +
  
  
Line 244: Line 247:
 
== [ALTERNATE WORKFLOW, Server] Server's Neighborhood-View. Server is connected. ==
 
== [ALTERNATE WORKFLOW, Server] Server's Neighborhood-View. Server is connected. ==
 
:[[File:C12.png|640px]]
 
:[[File:C12.png|640px]]
 +
 +
 +
 +
  
  
Line 249: Line 256:
 
== [ALTERNATE WORKFLOW, Client] Click on Server's "Access Share". ==
 
== [ALTERNATE WORKFLOW, Client] Click on Server's "Access Share". ==
 
:[[File:C13.png|640px]]
 
:[[File:C13.png|640px]]
 +
 +
 +
 +
 +
 +
  
 
== [ALTERNATE WORKFLOW, Client] Notification icon appears at bottom, signifying that the remote share has been locally mounted.. ==
 
== [ALTERNATE WORKFLOW, Client] Notification icon appears at bottom, signifying that the remote share has been locally mounted.. ==
 
:[[File:C14.png|640px]]
 
:[[File:C14.png|640px]]
 +
 +
 +
 +
  
  
Line 257: Line 274:
 
== [ALTERNATE WORKFLOW, Client] Initially, Documents folder is empty. ==
 
== [ALTERNATE WORKFLOW, Client] Initially, Documents folder is empty. ==
 
:[[File:C15.png|640px]]
 
:[[File:C15.png|640px]]
 +
 +
 +
 +
  
  
Line 262: Line 283:
 
== [ALTERNATE WORKFLOW, Server] Server gets disconnected. ==
 
== [ALTERNATE WORKFLOW, Server] Server gets disconnected. ==
 
:[[File:C16.png|640px]]
 
:[[File:C16.png|640px]]
 +
 +
 +
 +
  
  
Line 267: Line 292:
 
== [ALTERNATE WORKFLOW, Client] Tries to load the listview, for the locally-mounted remote share. ==
 
== [ALTERNATE WORKFLOW, Client] Tries to load the listview, for the locally-mounted remote share. ==
 
:[[File:C17.png|640px]]
 
:[[File:C17.png|640px]]
 +
 +
 +
 +
  
  
Line 272: Line 301:
 
== [ALTERNATE WORKFLOW, Client] CONNECTION-FAILED message appears. ==
 
== [ALTERNATE WORKFLOW, Client] CONNECTION-FAILED message appears. ==
 
:[[File:C18.png|640px]]
 
:[[File:C18.png|640px]]
 +
 +
 +
 +
  
  
Line 277: Line 310:
 
== [ALTERNATE WORKFLOW, Server] Server gets connected. ==
 
== [ALTERNATE WORKFLOW, Server] Server gets connected. ==
 
:[[File:C12.png|640px]]
 
:[[File:C12.png|640px]]
 +
 +
 +
 +
  
  
Line 282: Line 319:
 
== [ALTERNATE WORKFLOW, Client] Tries to load the listview, for the locally-mounted remote share. ==
 
== [ALTERNATE WORKFLOW, Client] Tries to load the listview, for the locally-mounted remote share. ==
 
:[[File:C17.png|640px]]
 
:[[File:C17.png|640px]]
 +
 +
 +
 +
 +
 +
  
 
== [ALTERNATE WORKFLOW, Client] Listview successfully seen. ==
 
== [ALTERNATE WORKFLOW, Client] Listview successfully seen. ==
 
:[[File:C20.png|640px]]
 
:[[File:C20.png|640px]]
 +
 +
 +
 +
  
  
Line 290: Line 337:
 
== [ALTERNATE WORKFLOW, Server] Server gets disconnected. ==
 
== [ALTERNATE WORKFLOW, Server] Server gets disconnected. ==
 
:[[File:C16.png|640px]]
 
:[[File:C16.png|640px]]
 +
 +
 +
 +
  
  
Line 295: Line 346:
 
== [ALTERNATE WORKFLOW, Client] Client tries to a copy a file, from locally-mounted remote share, to Documents. ==
 
== [ALTERNATE WORKFLOW, Client] Client tries to a copy a file, from locally-mounted remote share, to Documents. ==
 
:[[File:C21.png|640px]]
 
:[[File:C21.png|640px]]
 +
 +
 +
  
  
Line 301: Line 355:
 
== [ALTERNATE WORKFLOW, Client] CONNECTION-FAILED message appears. ==
 
== [ALTERNATE WORKFLOW, Client] CONNECTION-FAILED message appears. ==
 
:[[File:C22.png|640px]]
 
:[[File:C22.png|640px]]
 +
 +
 +
 +
 +
  
  
 
== [ALTERNATE WORKFLOW, Server] Server gets connected. ==
 
== [ALTERNATE WORKFLOW, Server] Server gets connected. ==
 
:[[File:C12.png|640px]]
 
:[[File:C12.png|640px]]
 +
 +
 +
 +
 +
  
  
 
== [ALTERNATE WORKFLOW, Client] Client tries to a copy a file, from locally-mounted remote share, to Documents. ==
 
== [ALTERNATE WORKFLOW, Client] Client tries to a copy a file, from locally-mounted remote share, to Documents. ==
 
:[[File:C21.png|640px]]
 
:[[File:C21.png|640px]]
 +
 +
 +
 +
 +
  
  
 
== [ALTERNATE WORKFLOW, Client] File copying, begins. ==
 
== [ALTERNATE WORKFLOW, Client] File copying, begins. ==
 
:[[File:C23.png|640px]]
 
:[[File:C23.png|640px]]
 +
 +
 +
 +
  
  
Line 318: Line 391:
 
== [ALTERNATE WORKFLOW, Server] Before file-copying is complete, server gets disconnected. ==
 
== [ALTERNATE WORKFLOW, Server] Before file-copying is complete, server gets disconnected. ==
 
:[[File:C16.png|640px]]
 
:[[File:C16.png|640px]]
 +
 +
 +
 +
 +
  
  
 
== [ALTERNATE WORKFLOW, Client] TIME-OUT message appears. ==
 
== [ALTERNATE WORKFLOW, Client] TIME-OUT message appears. ==
 
:[[File:C24.png|640px]]
 
:[[File:C24.png|640px]]
 +
 +
 +
 +
 +
  
  
 
== [ALTERNATE WORKFLOW, Server] Server gets connected. ==
 
== [ALTERNATE WORKFLOW, Server] Server gets connected. ==
 
:[[File:C12.png|640px]]
 
:[[File:C12.png|640px]]
 +
 +
 +
 +
 +
  
  
 
== [ALTERNATE WORKFLOW, Client] Client tries to a copy a file, from locally-mounted remote share, to Documents. ==
 
== [ALTERNATE WORKFLOW, Client] Client tries to a copy a file, from locally-mounted remote share, to Documents. ==
 
:[[File:C21.png|640px]]
 
:[[File:C21.png|640px]]
 +
 +
 +
 +
 +
  
  
 
== [ALTERNATE WORKFLOW, Client] File-copying finishes successfully. ==
 
== [ALTERNATE WORKFLOW, Client] File-copying finishes successfully. ==
 
:[[File:C25.png|640px]]
 
:[[File:C25.png|640px]]
 +
 +
 +
 +
 +
  
  

Revision as of 12:16, 8 May 2012

Contents

Proposal for a client-initiated journal transfer (1-to-N feature)

Note that the initial "Browse" based solution (of which comments have been struck out) cannot fill the purpose, because of the following reasons


  • (Thanks Anish) "Browse" based solution only allows files to be downloaded. But Sugar's entries are more than just a file - they are a combination of metadata, and data (files). Eg. - Turtle Art Journal entry.
  • (Thanks Anish and Daniel) Mounting the server's shares' entries locally, also conforms to the Sugar look-and-feel.


Workflow

  • The server XO would make its shares available via WebDAV, running in the context of "httpd" service.
  • The client XO would connect to the server XO via its browser.
  • Therafter, "Browse" would take over.
  • The client would mount the server's share locally.
  • Thereafter, the server's share's contents can be "copied" from, just as if it was just another local filesystem.


Details

  • Setting up WebDAV on a server XO.
    • Install package "httpd".
    • Generate openssl "server.crt" and "server.key".
       cd /etc/ssl/certs/
       sudo openssl req -new -newkey rsa:1024 -days 365 -nodes -x509 -keyout ssl.key -out ssl.crt
    • Configure "/etc/httpd/conf.d/ssl.conf" "/etc/httpd/conf/httpd.conf" to setup the WebDAV share. Sample file : media:httpd.conf
      • Firstly, this sets up the paths "SSLCertificateFile" and "SSLCertificateKeyFile", which are required for HTTPS over SSL.
      • SecondlyThis sets up "/var/www/web1/web" as the "webdav" folder. In other words, whetever entries are present in this folder, will be made available for the client XOs.
    • Generate authentication file for the webdav folder. These user-password credentials will be asked whenever a client tries to access the webdav folder. For example, the following list of commands sets "test" as the user, and "olpc" as the password.
       sudo htpasswd -c /var/www/web1/passwd.dav test
       New password:  <olpc>
       Re-type new password:  <olpc> 
       Adding password for user test
    • Start service "httd".
    • ALL THESE STEPS WOULD BE DONE AS PART OF OOB STAGE.



  • [User-Workflow] Exporting Data to WebDav, on a server XO.
    • Add "Share" listview in the bottom panel-tray; that would make a total of 4 types of listview - Journal, Documents, Mounted-Drives, Share.
    • "Share" would follow all the schematics of "Documents" type. After all, "Share" is just a folder in the filesystem (like "Documents").
    • The corresponding folder is "/var/www/web1/web" (as configured in "/etc/httpd/conf.d/ssl.conf").
    • All entries in the "Share" folder would be available to client XOs.


  • [Code-Requirements] Exporting Data to WebDav, on a server XO.
    • "Share" listview needs to be added on the lines of "Documents" listview. Code-reuse should be done as much as possible. Ideally, there should just be a difference of the "folder-path".


  • [User-Workflow] Client XO wishes to access the share of Server XO.
    • Navigates to the "Neighborhood" view.
    • Hovers over the "Server" buddy.
    • The popup appears, which has a new entry "Access Share" (in addition to "Make Friend").
    • Clicks on "Access Share".
    • The "Browser" activity opens, with the url pointing to the "Server" buddy's webdav share.
    • Thereafter, client may navigate the webdav directory hierarchy, or download files (all of which is already built in the "Browse" activity). Most importantly, there is the "Keep Link" feature in "Browse", which nicely downloads the webdav-entry, and promptly saves it in the "Journal" - something that happens in the "Send To" feature as well.
    • The server's share is mounted. A color-specific buddy-icon in the bottom tray signifies it. Clicking this icon displays the server's share's entries, on the lines of Journal/Documents/Shares/Mounted-Drives.
    • Now, the entries can be copied from the mounted folder, to Journal/Documents/Shares/Mounted-Drives.


  • [Code-Requirements] Client XO wishes to access the share of Server XO.
    • Mapping a neighborhood-buddy to its IP Address
      • Luckily, in the method "def __buddy_updated_cb(self, account, contact_id, properties):" in "jarabe/model/neighborhood.py", there is the "properties['ip4-address']", which contains the IP address of the buddy. All that is needed is to persist it in the "BaseBuddyModel" in "jarabe/model/buddy.py".
      • When the client clicks on "Access Share" on the buddy, this IP Address can be easily retreived, and the URI formed "https://<IP Address>/webdav"
    • Opening up the server's webdav
      • The generated URI would be passed to the "Browse" activity; and thereafter, "Browse" would take over.
    • A minor query, regarding the last point, has been posted at http://lists.sugarlabs.org/archive/sugar-devel/2012-April/036425.html. (For resolving this, some additional code may have to be written, but that is something perfectly doable. However, currently awaiting a reply, to see if the code for this already exists :-) ).


SCREENSHOTS

[Server 1] Launch "Turtle Art"

S111.png




[Server 1] Modify "Turtle Art" workspace and then "Close".

S121.png




[Server 1] Initially, "Shares" is empty.

S13.png




[Server 1] Copy "Turtle Art" journal entry, to "Shares".

S14.png





[Server 2] Launch "Turtle Art"

S21.png




[Server 2] Modify "Turtle Art" workspace and then "Close".

S22.png




[Server 2] Initially, "Shares" is empty.

S23.png




[Server 2] Copy "Turtle Art" journal entry, to "Shares".

S24.png




[Client] Server-1 and Server-2 buddy icons in Neighborhood-view.

C1.png




[Client] Click on Server-1's "Access Share".

C2.png




[Client] Notification icon appears at botton, signifying that the remote share has been locally mounted.

C3.png





[Client] Click on Server-2's "Access Share".

C4.png




[Client] Notification icon appears at bottom, signifying that the remote share has been locally mounted.

C5.png




[Client] Initially, "Journal" is empty.

C6.png




[Client] Click on Server-1's share.

C7.png




[Client] Download-and-Copy the entry to Journal.

C8.png




[Client] Click on Server-2's share.

C9.png




[Client] Download-and-Copy the entry to Journal.

C10.png




[Client] Server-1's Turtle-Art entry, successfully replicated at client.

C11.png




[ALTERNATE WORKFLOW, Server] Server's Neighborhood-View. Server is connected.

C12.png




[ALTERNATE WORKFLOW, Client] Click on Server's "Access Share".

C13.png




[ALTERNATE WORKFLOW, Client] Notification icon appears at bottom, signifying that the remote share has been locally mounted..

C14.png




[ALTERNATE WORKFLOW, Client] Initially, Documents folder is empty.

C15.png




[ALTERNATE WORKFLOW, Server] Server gets disconnected.

C16.png




[ALTERNATE WORKFLOW, Client] Tries to load the listview, for the locally-mounted remote share.

C17.png




[ALTERNATE WORKFLOW, Client] CONNECTION-FAILED message appears.

C18.png




[ALTERNATE WORKFLOW, Server] Server gets connected.

C12.png




[ALTERNATE WORKFLOW, Client] Tries to load the listview, for the locally-mounted remote share.

C17.png




[ALTERNATE WORKFLOW, Client] Listview successfully seen.

C20.png




[ALTERNATE WORKFLOW, Server] Server gets disconnected.

C16.png




[ALTERNATE WORKFLOW, Client] Client tries to a copy a file, from locally-mounted remote share, to Documents.

C21.png




[ALTERNATE WORKFLOW, Client] CONNECTION-FAILED message appears.

C22.png




[ALTERNATE WORKFLOW, Server] Server gets connected.

C12.png




[ALTERNATE WORKFLOW, Client] Client tries to a copy a file, from locally-mounted remote share, to Documents.

C21.png




[ALTERNATE WORKFLOW, Client] File copying, begins.

C23.png




[ALTERNATE WORKFLOW, Server] Before file-copying is complete, server gets disconnected.

C16.png




[ALTERNATE WORKFLOW, Client] TIME-OUT message appears.

C24.png




[ALTERNATE WORKFLOW, Server] Server gets connected.

C12.png




[ALTERNATE WORKFLOW, Client] Client tries to a copy a file, from locally-mounted remote share, to Documents.

C21.png




[ALTERNATE WORKFLOW, Client] File-copying finishes successfully.

640px




[ALTERNATE WORKFLOW, Client] Documents Listview.

C26.png








[ARCHIVE] Possible options

In a server-initiated operation, the server is responsible for adequate delivery to all the clients, whatever the number may be. In a client-initiated operation, each client is responsible for herself only.


Option Server-Initiated / Client-Initiated Secure Data Transfer Proxy Support Peer to Peer Support (Gabble/Salut)
Looping over "Send To" Server-Initiated Yes/Yes
Sascha's JournalToWebDAV Client-Initiated
Each XO acts as an independent WebDAV server; client uses browser Client-Initiated Yes (HTTPS over SSL) /Yes