<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>server/client/AC_OETags.js</filename>
    </added>
    <added>
      <filename>server/client/FlexClient.html</filename>
    </added>
    <added>
      <filename>server/client/FlexClient.swf</filename>
    </added>
    <added>
      <filename>server/client/flexclient/view/assets/banner.png</filename>
    </added>
    <added>
      <filename>server/client/flexclient/view/assets/banner.xcf</filename>
    </added>
    <added>
      <filename>server/client/history/history.css</filename>
    </added>
    <added>
      <filename>server/client/history/history.js</filename>
    </added>
    <added>
      <filename>server/client/history/historyFrame.html</filename>
    </added>
    <added>
      <filename>server/client/playerProductInstall.swf</filename>
    </added>
    <added>
      <filename>server/index.html</filename>
    </added>
    <added>
      <filename>server/services/main.py</filename>
    </added>
    <added>
      <filename>server/stylesheets/main.css</filename>
    </added>
    <added>
      <filename>update_gae.cmd</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -15,7 +15,7 @@ PREREQUISITES
 * Flex Builder 3 or Flex SDK
 * Python 2.5
 
-INSTRUCTIONS
+INSTRUCTIONS FOR WORKING LOCALLY
 
 1. Start the server:
 On a Windows environment, run start-server.cmd. Or do this:
@@ -30,3 +30,21 @@ python client.py initialize
 cd flex-client
 cd bin-debug
 main.html
+
+INSTRUCTIONS FOR DEPLOYING ON GOOGLE APP ENGINE
+
+1. Create an empty application on Google App Engine. Lets call it &quot;yourapp&quot;.
+2. Edit the file server/app.yaml and change pyamftest to your app's name:
+   application: yourapp
+3. In the file flex-client/src/flexclient/model/ServiceGateway.as change
+   http://localhost:8080/services/ to http://yourapp.appspot.com/services/
+4. Optionally, in the file python-client/client.py make the same change.
+5. Build the Flex app in release mode and save it to the server/client
+   directory. In Flex Builder this can be done with the
+   Project &gt; Export Release Build command.
+6. On a Windows environment run the update_gae.cmd script or type this:
+   appcfg.py update server/
+7. If you changed client.py you can use it to create some sample data:
+   cd python-client
+   client.py initialize
+8. Browse to http://yourapp.appspot.com and click on Edit projects.</diff>
      <filename>README.txt</filename>
    </modified>
    <modified>
      <diff></diff>
      <filename>flex-client/bin-debug/FlexClient.swf</filename>
    </modified>
    <modified>
      <diff>@@ -11,7 +11,7 @@ package flexclient.model
             if (connection == null)
             {
                 connection = new NetConnection();
-                connection.connect(&quot;http://localhost:8080/&quot;);
+                connection.connect(&quot;http://localhost:8080/services/&quot;);
             }
             return connection;
         }</diff>
      <filename>flex-client/src/flexclient/model/ServiceGateway.as</filename>
    </modified>
    <modified>
      <diff>@@ -27,16 +27,18 @@ from pyamf.remoting.client import RemotingService
 def usage():
     print __doc__
 
+def get_service(service_name):
+    gateway = RemotingService('http://localhost:8080/services/')
+    return gateway.getService(service_name)
+
 def test():
-    gateway = RemotingService('http://localhost:8080/')
-    project_service = gateway.getService('EchoService')
+    project_service = get_service('EchoService')
     print project_service.echo('test')
     print project_service.echo_upper('test')
     print project_service.echo_upper(1)
 
 def insert(code, name):
-    gateway = RemotingService('http://localhost:8080/')
-    project_service = gateway.getService('ProjectsService')
+    project_service = get_service('ProjectsService')
     new_project = {
         &quot;code&quot;: int(code),
         &quot;name&quot;: name,
@@ -46,16 +48,14 @@ def insert(code, name):
     print_project(project)
 
 def update(code, name):
-    gateway = RemotingService('http://localhost:8080/')
-    project_service = gateway.getService('ProjectsService')
+    project_service = get_service('ProjectsService')
     project = project_service.get_by_code(int(code))
     project.name = name
     project = project_service.save(project)
     print_project(project)
 
 def get(code):
-    gateway = RemotingService('http://localhost:8080/')
-    project_service = gateway.getService('ProjectsService')
+    project_service = get_service('ProjectsService')
     project = project_service.get_by_code(int(code))
     if project == None:
         print &quot;Project %s not found.&quot; % (code)
@@ -63,8 +63,7 @@ def get(code):
         print_project(project)
 
 def delete(codes):
-    gateway = RemotingService('http://localhost:8080/')
-    project_service = gateway.getService('ProjectsService')
+    project_service = get_service('ProjectsService')
     for code in codes:
         project = project_service.get_by_code(int(code))
         if project != None:
@@ -72,9 +71,8 @@ def delete(codes):
 
 def initialize():
     # prepare service objects
-    gateway = RemotingService('http://localhost:8080/')
-    project_service = gateway.getService('ProjectsService')
-    project_participants_service = gateway.getService('ProjectParticipantsService')
+    project_service = get_service('ProjectsService')
+    project_participants_service = get_service('ProjectParticipantsService')
 
     # delete all participants
     participants = project_participants_service.get_all()
@@ -122,15 +120,13 @@ def initialize():
         project_participants_service.save(participant)
 
 def all():
-    gateway = RemotingService('http://localhost:8080/')
-    project_service = gateway.getService('ProjectsService')
+    project_service = get_service('ProjectsService')
     projects = project_service.get_all()
     for project in projects:
         print_project(project)
 
-def participants():        
-    gateway = RemotingService('http://localhost:8080/')
-    project_participants_service = gateway.getService('ProjectParticipantsService')
+def participants():
+    project_participants_service = get_service('ProjectParticipantsService')
     participants = project_participants_service.get_all()
     for participant in participants:
         pprint(participant)</diff>
      <filename>python-client/client.py</filename>
    </modified>
    <modified>
      <diff>@@ -9,5 +9,14 @@ handlers:
   upload: crossdomain\.xml
   expiration: &quot;5s&quot;
 
+- url: /stylesheets
+  static_dir: stylesheets
+
+- url: /client
+  static_dir: client
+
+- url: /services/.*
+  script: services/main.py
+
 - url: .*
   script: main.py</diff>
      <filename>server/app.yaml</filename>
    </modified>
    <modified>
      <diff>@@ -1,16 +1,25 @@
+import cgi
+import os
 import wsgiref.handlers
-from pyamf.remoting.gateway.wsgi import WSGIGateway
-from services import EchoService, ProjectsService, ProjectParticipantsService
 
-services = {
-    'EchoService': EchoService.EchoService,
-    'ProjectsService': ProjectsService.ProjectsService,
-    'ProjectParticipantsService': ProjectParticipantsService.ProjectParticipantsService,
-}
+from google.appengine.ext import db
+from google.appengine.ext import webapp
+from google.appengine.ext.webapp import template
+from services.Model import Project, ProjectParticipant
+
+class MainPage(webapp.RequestHandler):
+  def get(self):
+    projects = Project.all().order('name')
+    template_values = {
+        'projects': projects,
+    }
+    path = os.path.join(os.path.dirname(__file__), 'index.html')
+    self.response.out.write(template.render(path, template_values))
 
 def main():
-    application = WSGIGateway(services)
+    application = webapp.WSGIApplication([('/', MainPage)],
+                                         debug=True)
     wsgiref.handlers.CGIHandler().run(application)
-
-if __name__ == '__main__':
-    main()
+  
+if __name__ == &quot;__main__&quot;:
+  main()</diff>
      <filename>server/main.py</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>82e060dc79d9217e1bcc2d4b344b8b37c729d293</id>
    </parent>
  </parents>
  <author>
    <name>Fernando Correia</name>
    <email>fernandoacorreia@gmail.com</email>
  </author>
  <url>http://github.com/fernandoacorreia/flex-and-python-test/commit/e2f4c52ac43e26e55a22c28196a6f474980ce1d5</url>
  <id>e2f4c52ac43e26e55a22c28196a6f474980ce1d5</id>
  <committed-date>2008-08-14T17:16:39-07:00</committed-date>
  <authored-date>2008-08-14T17:16:39-07:00</authored-date>
  <message>Prepare for deployment on GAE</message>
  <tree>454d342715b76e3437ea6d9c5183ffd2c2ea0e3c</tree>
  <committer>
    <name>Fernando Correia</name>
    <email>fernandoacorreia@gmail.com</email>
  </committer>
</commit>
