Google App Engine Developer - Day1
Upcoming SlideShare
Loading in...5
×
 

Google App Engine Developer - Day1

on

  • 487 views

Start to use Java App Engine

Start to use Java App Engine
- Install & deploy
- First code, make a simple UI
- User login integrate

Statistics

Views

Total Views
487
Slideshare-icon Views on SlideShare
486
Embed Views
1

Actions

Likes
0
Downloads
33
Comments
0

1 Embed 1

http://www.slideee.com 1

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Google App Engine Developer - Day1 Google App Engine Developer - Day1 Presentation Transcript

    • GAE Developer - Day1 Simon @ MiCloud 2014Q1
    • ● https://developers.google.com/eclipse/docs/getting_started?hl=zh-tw Install GAE Eclipse Plugin
    • Install GAE Eclipse Plugin ● Eclipse 4.3 (Kepler) ○ https://dl.google.com/eclipse/plugin/4.3 ● Eclipse 3.8/4.2 (Juno) ○ https://dl.google.com/eclipse/plugin/4.2 ● Eclipse 3.7 (Indigo) ○ https://dl.google.com/eclipse/plugin/3.7
    • Install GAE Eclipse Plugin
    • First GAE App ● Create GAE web project ● Review project & Edit Servlet ● Deploy to GAE
    • Create GAE Web Project
    • Going to Project Detail Java source code Web source code GAE setting Servlet setting
    • Local Develop Server
    • Local Server Supports ● Jetty Servlet container ● Admin page ● Datastore - HDR ● MySQL connect
    • Local Admin Console
    • Deploy GAE to Cloud
    • Getting Start….
    • GAE預設值... ● Stateless - no session enabled ● Without app stat page ● Have JSP standard UserPrinciple object for authentication ● Cannot DB connection ● JSTL support
    • 建立簡單的UI - https://jetstrap.com
    • 整合到專案
    • Enable Session...
    • 基本設定 - Enable Session
    • Enable App State...
    • App Stats Servlet <!-- direct /appstats requests to built-in appstats tool --> <servlet> <servlet-name>appstats</servlet-name> <servlet-class>com.google.appengine.tools.appstats.AppstatsServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>appstats</servlet-name> <url-pattern>/appstats/*</url-pattern> </servlet-mapping> <!-- appstats to record statistics/metrics for each request --> <filter> <filter-name>appstats</filter-name> <filter-class>com.google.appengine.tools.appstats.AppstatsFilter</filter-class> </filter> <filter-mapping> <filter-name>appstats</filter-name> <url-pattern>/*</url-pattern> </filter-mapping>
    • http://localhost:8888/appstats/stats
    • Use User Service….
    • User Service Callback Page Result Page extends: AbstractAppEngineAuthor izationCodeServlet extends: AbstractAppEngineAuthor izationCodeCallbackServl et G 1 2 34
    • <%@ page contentType="text/html;charset=UTF-8" language="java" %> <%@ page import="java.util.List" %> <%@ page import="com.google.appengine.api.users.User" %> <%@ page import="com.google.appengine.api.users.UserService" %> <%@ page import="com.google.appengine.api.users.UserServiceFactory" %> <% UserService userService = UserServiceFactory.getUserService(); User user = userService.getCurrentUser(); if (user != null) { pageContext.setAttribute("user", user); %> <a href="<%= userService.createLogoutURL(request.getRequestURI()) %>">sign out</a>.)</p> <a href="<%= userService.createLoginURL(request.getRequestURI()) %>">Sign in</a> 整合User Service
    • Others...
    • ● 預設Datastore: com.google.api.client. extensions.appengine.auth.oauth2. AppEngineCredentialStore User service default store
    • 取得App Engine Id import com.google.apphosting.api.ApiProxy; ApiProxy.getCurrentEnvironment().getAppId();
    • Team Work - Invite Cooperate User
    • Q&A END