Skip to content

luscoma/PPT-HTTP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PPT over HTTP
-------------------------------
There are a lot of phone applications which allow the control of ppt over wifi and bluetooth but in some cases this is not possible particularly when at a conference or other area where bluetooth may not be available and the wifi may have restrictions for user devices.

In those cases it would be preferrable to tunnel the ppt commands over http.  The goal of this service is to allow a device to register a presentation and receive a PPT ID.  This ID is then used to push presentation commands over http into the web-service by a handheld device such as a phone.  On the presentation end one of two cases should occur:
 * If google docs like: an ajax request should be made to long poll the service waiting for command input.  Once received the command should be executed and another long poll should occur.
 * If microsoft ppt like: an external application should be long poll the service waiting for command input.  Once received the command shoould be performed via the interop libraries then another long poll should occur
Ultimately this will require a web framework meant to work well with long polling such as tornado but since I am just learning app-engine the built-in one is fine.

The current implementation allows a server to register a presentation at /service/register (details of the web methods are below). The ID of the presentation is returned through JSON.  
This id is then used by the client to post commands (defined below) to /service/present/{id}
The server then performs a get request on /service/prsent/{id} to retreive any waiting commands which are returned via JSON

Goals
---------------------
Short-term goals: basic web stuff works even if done by hand, no long polling implemented, just a proof of concept
Mid-term goals: .NET application which can control power-point (I'd do google docs, but can't exactly inject my scripts into the page or control the presentation easily) using the web-service.  At this point probably still push commands to the server by hand
Mid-Long term goal: android client application, this is a longer-term goal because it requires me to write an android app which I haven't done before
Long-term goal: Once its clear it works, either study up on how I can control the google presentation (if its even possible).  Or work for google and be able to actually implement it :)

TODO
--------------------
* Do cron task which deletes old data items that have expired (in accordance to the heartbeat)
* Work on controlling powerpoint via .net interop and manual commands sent to the web-service (not easily possible right now since the channel api is javascript only.  Would have to embed a web browser and do some nastiness)

Documentation
---------------------
1. Files
1.1 home.py - A landing page write now, uses index.html to serve a static http page which has a form that can be used to register a new ppt.  Just for testing nothing special
1.2 service.py - The actual service implementation implements anything for /service
1.3 presentation.py - The presentation data model stored in the google database, also defines some support functions to ease interaction
1.4 test_env_setup - Bash script which if run using '. ./test_env_setup' will export a bunch of commands into the shell which interact with the web-service via curl.  Explained in detail in section 4
1.5 index.html - Basic landing page, this will be fledge out later

2. Service
2.1 Registration - Occurs at end-point /service/register/[id].  Id is optional and is not required when performing a get request (Note: I may change some of this routing later we'll see)
2.1.1 GET - /service/register/{id} - Returns a JSON object with the presentation details including Name, NumberSlides, DateCreated
2.1.2 POST - /service/register - Requires 'name' and 'slides' post variables.  Returns a JSON object with id set to the ppt id and a channel id token
2.1.3 DELETE - /service/register/{id} - Deletes the presentation out of the database. Currently the ids are sequential... so you can wreck havoc if someone really wanted to we'll see if this needs to be addressed much later
2.2 Presentation - Occurs at end-point /service/present/{id}
2.2.2 POST - /service/present/{id} - Posts a new action to the queue for the given presentation.  Actions are discussed in section 3.
2.3 Channel -  used for communication back with the presentation web page, see google channel api documentation.  The channel token is returned during registration.

3. Actions - All actions are posted to the server at /service/present/{id} using the form variable action={action}
3.1 prev - Posts a previous command to the server, if directly preceeded by a next command this action deletes the next command and is ignored
3.2 next - Posts a next command to the server, if directly preceeded by a prev command this action deletes the prev command and is ignored
3.3 first - Moves to the first slide in the presentation, clears any existing actions in the queue
3.4 last - Moves to the last slide in the presentation, clears any existing actions in the queue
3.5 goto - Goes to a slide in the presentation, in addition to action=goto the slide=# must also be included in the post data.  If slide is more than the number of slides possible a 500 status code is returned indicating failure.

4. Manual Test Environment - Executing test_env_setup as . ./test_env_setup loads several functions for support
4.1 Variables
4.1.1 ppt_url - the current url to use for the support functions defaults to ppt_local_url
4.1.2 ppt_local_url - the url for accessing the development version of the site
4.1.3 ppt_remote_url - the url for accessing the production version of the site
4.2 Functions
4.2.1 ppt_newppt [name] [slides] - creates a new ppt presentation with a name and slides optional (default values are used if not), returns pptid
4.2.2 ppt_getppt pptid - asks the service for an information on the given presentation
4.2.3 ppt_deleteppt pptid - deletes the presentation out of the database
4.2.4 ppt_pushaction pptid action - pushes an action specified in section 3 to the presentations queue, not used for goto
4.2.5 ppt_gotoaction pptid slide - pushes a goto action onto the presentations action queue given the slide #

About

Controls a PPT over HTTP

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages