forked from google/google-api-java-client-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstructions.html
135 lines (116 loc) · 4.97 KB
/
instructions.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
<html>
<title>calendar-appengine-sample</title>
<body>
<h2>Instructions for the Calendar App Engine Sample</h2>
<h3>Browse Source Code</h3>
<ul>
<li><a
href="http://code.google.com/p/google-api-java-client/source/browse/calendar-appengine-sample/?repo=samples">Browse
Source</a> or main file <a
href="http://code.google.com/p/google-api-java-client/source/browse/calendar-appengine-sample/src/main/java/com/google/api/services/samples/calendar/appengine/server/CalendarAppEngineSample.java?repo=samples">CalendarAppEngineSample.java</a></li>
</ul>
<h3>Register Your Application</h3>
<ul>
<li>Visit the <a href="https://cloud.google.com/console/start/api?id=calendar">Google Cloud
console</a>.
</li>
<li>If necessary, sign in to your Google Account, select or create a project,
and agree to the terms of service. Click Continue.</li>
<li>Select the "Web Application" platform, and click Register.</li>
<li>Within "OAuth 2.0 Client ID", click on "Download JSON". Later on, after you check
out the sample project, you will copy this downloaded file (e.g.
<code>~/Downloads/client_secrets.json</code>) to
<a href="src/main/resources/client_secrets.json">src/main/resources/client_secrets.json</a>.
If you skip this step, when trying to run the sample you will get a <code>400
INVALID_CLIENT</code> error in the browser.
</li>
<li>Within "OAuth 2.0 Client ID", in the "Redirect URI" field enter some
redirect URIs, for example
"https://yourappname.appspot.com/oauth2callback" and
"http://localhost:8888/oauth2callback".
</li>
</ul>
<h3>Checkout Instructions</h3>
<p>
<b>Prerequisites:</b> install <a href="http://java.com">Java 6</a>, <a
href="http://code.google.com/webtoolkit/download.html">GWT</a>, <a
href="https://developers.google.com/appengine/downloads">Google App
Engine</a>, <a href="http://mercurial.selenic.com/">Mercurial</a>, and <a
href="http://maven.apache.org/download.html">Maven</a>. You may need to
set your
<code>JAVA_HOME</code>
.
</p>
<pre>
cd <i>[someDirectory]</i>
hg clone https://code.google.com/p/google-api-java-client.samples/ google-api-java-client-samples
cd google-api-java-client-samples/calendar-appengine-sample
cp ~/Downloads/client_secrets.json src/main/resources/client_secrets.json
mvn clean package
</pre>
<p>To enable logging of HTTP requests and responses (highly recommended
when developing), please take a look at <a href="src/main/webapp/WEB-INF/logging.properties">logging.properties</a>.</p>
<h3>Running and Deploying Your Application from the Command Line</h3>
<p>To run your application locally on a development server:</p>
<pre>
mvn appengine:devserver
</pre>
<p>To deploy your application to appspot.com:</p>
<p>
If this is the first time you are deploying your application to appspot.com, you will to perform the
following steps first.
</p>
<ul>
<li>Go to <a href="https://appengine.google.com/">https://appengine.google.com</a> and create an application.</li>
<li>Edit src/main/webapp/WEB-INF/appengine-web.xml, and enter the unique application identifier (you chose it in the prior step)
between the <application> tags.</li>
</ul>
<p> If you've done the above, you can deploy at any time: </p>
<pre>
mvn appengine:update
</pre>
<p>If this is the first time you have run "update" on the project, a browser window will open prompting you to log in.
Log in with the same Google account the app is registered with.
</p>
<h3>Setup Project in Eclipse</h3>
<p>
<b>Prerequisites:</b> install <a href="http://www.eclipse.org/downloads/">Eclipse</a>,
<a href="http://code.google.com/eclipse/">Google Plugin for Eclipse</a>, and
the <a href="http://javaforge.com/project/HGE">Mercurial plugin</a>.
</p>
<ul>
<li>Setup Eclipse Preferences
<ul>
<li>Window > Preferences... (or on Mac, Eclipse >
Preferences...)</li>
<li>Select Maven
<ul>
<li>check on "Download Artifact Sources"</li>
<li>check on "Download Artifact JavaDoc"</li>
</ul>
</li>
</ul>
</li>
<li>Import <code>calendar-appengine-sample</code> project
<ul>
<li>File > Import...</li>
<li>Select "General > Existing Project into Workspace" and click
"Next"</li>
<li>Click "Browse" next to "Select root directory", find <code>
<i>[someDirectory]</i>/google-api-java-client-samples/calendar-appengine-sample
</code> and click "Next"
</li>
<li>Click "Finish"</li>
<li>NOTE: please ignore the "The App Engine SDK JAR * is missing in
the WEB-INF/lib directory" error messages.</li>
</ul>
</li>
<li>Run
<ul>
<li>Right-click on project calendar-appengine-sample</li>
<li>Run As > Web Application</li>
</ul>
</li>
</ul>
</body>
</html>