Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Audrey (https://github.com/audreyt/) has been working on "Ethercalc" (https://github.com/audreyt/ethercalc) for over a year now and the demo's look really great.
After searching the Issue tracker I didnt find any reference. Now my question is of course "Would it be easy to implement?".
I know I should try myself before asking, but people who got their head into the socialcalc module code have a better overview of it all.
Where would the issues be when implementing this? Like big API differences or workflow?
Comments
Comment #1
infojunkie2 things need to happen to integrate Ethercalc into Sheetnode:
* Merge Ethercalc frontend JS code into SocialCalc on GitHub
* Port EtherCalc backend code into a Sheetnode sub-module.
I can't start this effort but I would definitely help if someone wants to try it.
Comment #2
infojunkieA better approach might be to:
* Merge EtherCalc frontend JS into SocialcCalc (as above)
* Run EtherCalc server alongside Drupal - this way we reuse this project instead of porting it. The challenge here is to share backend data such as authentication between EtherCalc and Drupal.
Comment #3
audreyt CreditAttribution: audreyt commentedOne possible way around the need for authentication: Have a server-side secret in SheetNode, and initialize EtherCalc with RoomID calculated as HASH(Secret, NodeID), so the user cannot guess the room ID of other nodes.
That way, given a running EtherCalc server running at e.g. port 8000, SheetNode can simply POST to http://HOST:8000/RoomID with the SocialCalc serialization whenever a node saves.
(One can obtain a running EtherCalc server with npm: "sudo npm install -g ethercalc; ethercalc" would start the server.)
When a user opens a sheet node for editing, the server can render SocialCalc as usual, set location.hash to #RoomID, make sure SocialCalc.CurrentSpreadsheetControlObject is set, then serve these three JS files to the client:
http://HOST:8000/socket.io/socket.io.js
http://HOST:8000/zappa/zappa.js
http://HOST:8000/player.js
That will initiate a collaborative session for all users who open the node for editing.
As EtherCalc works by keeping a server-side jsDOM+SocialCalc that runs commands in tandem with clients, a port to PHP would still require embedding an in-process JavaScript engine. In light of this, keeping the node.js server alongside PHP seems more practical to me. (This is also why I didn't attempt a backport to Perl 5.)
As @infojunkie said in #1, I'm afraid I don't have cycles to start this project, but will gladly help if someone wants to attempt an integration.
Cheers,
Audrey
Comment #4
infojunkieHey Audrey, thanks for chiming in. Great job on Ethercalc! Your approach sounds simple enough to try. I hope I get some time to follow the instructions soon.
Comment #5
audreyt CreditAttribution: audreyt commentedHi, I've just implemented a proof-of-concept (localhost only) collaboration with EtherCalc in the 7.x-1.x branch:
https://github.com/audreyt/sheetnode/commit/3587a107a94355d2a9e232835bf9...
It requires running the latest version (ethercalc-0.20120701.233740) from NPM:
sudo npm i -g ethercalc
ethercalc
Alternately, checking out from https://github.com/audreyt/ethercalc/ should also work:
git clone git://github.com/audreyt/ethercalc.git
cd ethercalc
npm i
make
Over the next week I'll add a dedicated ethercalc.module for setting the host/port/prefix (so remote connections would work), and factor out the spreadsheet/init javascripts into that module. Comments/thoughts/feedbacks welcome!
Comment #6
infojunkieThanks Audrey for going ahead with this! I'll play with it soon.
Comment #7
infojunkieI was able to run Sheetnode in multi-player mode! Woohoo! I forked the Sheetnode repo on Github to be able to work on this.
Some issues:
* Opening the second instance of the sheet in another browser did not load the initial sheet data (that's saved in the Drupal database)
* Socialcalc graphic files path is b0rked on my machine. My Drupal installation is at http://localhost/d7 and it was looking for http://localhost/d7/http://localhost:8000/socialcalc/images/sc-more-vn.gif for example.
* Ethercalc JS files were not found using the latest server-agnostic code. I had to hard-code the http://localhost:8000 URL to get the files to load.
I also have some questions about features, so maybe we could have a Skype chat or something to align the roadmaps. My timezone is GMT-8.
Comment #8
audreyt CreditAttribution: audreyt commentedSure thing. My skype ID is "audrey.tang". Please feel free to typeahead if I'm away as I'm working mostly asynchronously nowadays. :-)
Comment #9
audreyt CreditAttribution: audreyt commentedHi, FYI, I fixed both the imagePrefix and server-agnostic issues in https://github.com/audreyt/sheetnode/. Please give it a try at your convenience.
Comment #10
infojunkiePushed sheetnode_ethercalc submodule to replicate Github integration module.
Also happy to announce that audreyt will be co-maintaining Sheetnode! Welcome aboard.
Comment #11
infojunkieTo test, install and run EtherCalc:
Then create a new sheet and save it. Edit it again, and then open another browser and edit it also. You should have live sync between the two instances.
TODO:
* Show EtherCalc functionality when it's active (e.g. a special icon)
* Cleanup EtherCalc backend when a sheetnode is deleted
* Support multiple sheets per page
* Show users who are simultaneously editing the sheet
* Provide a chat area (should be a standalone module or find an existing one)
* Add status message to detect EtherCalc backend
Comment #12
infojunkieBackported sheetnode_ethercalc to Drupal 6.
Comment #13
infojunkieAdded option to activate EtherCalc on Fiddle mode.
Comment #14
infojunkieMarking this as fixed for now. We can open new issues for remaining tasks.