Currently, starting a certain service on a document is done manually. For example, bin/runner.coffee, just connects to http://localhost:8002/channel, opens document "code:test", and starts the stex/hider and stex/transclusion services on that document. What we would like to have is some way of enabling these services
on any document (not only on code:test)
doing so from the Web interface itself
Idea 1:
Add a REST service for enabling (and also disabling) a service on a certain document. So when:
http://localhost:8002/enable/stex-hider/code:test is invoked - the service stex-hider is enabled for document code:test
Big problem of this approach is security.
Idea 2:
The editor maintains a double sided connection with ShareJS. Using this connection would take care of the security issues but would require changes in the ShareJS code - something we don't want to have. We might need to adapt the browserchannel.coffee so that it can handle enable requests.
Steps:
1) Copy share/src/server/browserchannel.coffee into redsys/bin
2) Add API for enabling/disabling services (take a look at runner.coffee how this is done)
would be nice to have this functionality in a different function
3) index.html has the client side code. The "doc" variable can send server messages doc.connection.send() - should use the new API to enable some service.
Currently, starting a certain service on a document is done manually. For example, bin/runner.coffee, just connects to http://localhost:8002/channel, opens document "code:test", and starts the stex/hider and stex/transclusion services on that document. What we would like to have is some way of enabling these services
Idea 1: Add a REST service for enabling (and also disabling) a service on a certain document. So when: http://localhost:8002/enable/stex-hider/code:test is invoked - the service stex-hider is enabled for document code:test Big problem of this approach is security.
Idea 2: The editor maintains a double sided connection with ShareJS. Using this connection would take care of the security issues but would require changes in the ShareJS code - something we don't want to have. We might need to adapt the browserchannel.coffee so that it can handle enable requests.