forked from google/google-api-java-client-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstructions.html
More file actions
101 lines (90 loc) · 3.34 KB
/
Copy pathinstructions.html
File metadata and controls
101 lines (90 loc) · 3.34 KB
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
<html>
<title>docs-cmdline-sample</title>
<body>
<h2>Instructions for the Documents List Command-Line Sample</h2>
<h3>Browse Online</h3>
<ul>
<li><a
href="http://code.google.com/p/google-api-java-client/source/browse?repo=samples#hg/docs-cmdline-sample">Browse
Source</a>, or main file <a
href="http://code.google.com/p/google-api-java-client/source/browse/docs-cmdline-sample/src/main/java/com/google/api/services/samples/docs/cmdline/DocsSample.java?repo=samples">DocsSample.java</a></li>
</ul>
<h3>Register Your Application</h3>
<ul>
<li>Visit the <a href="https://code.google.com/apis/console/">Google
apis console</a>
</li>
<li>If this is your first time, click "Create project..."</li>
<li>Click on "API Access", and then on "Create an OAuth 2.0 Client
ID...".</li>
<li>Enter a product name and click "Next".</li>
<li>Select "Installed application" and click "Create client ID".</li>
<li>Enter the "Client ID" and "Client secret" shown under "Client ID
for installed applications" into <a
href="src/main/resources/client_secrets.json">src/main/resources/client_secrets.json</a>
file after checking out the code (otherwise you will get a <code>400
INVALID_CLIENT</code> error in the browser when running the sample).</li>
</ul>
<h3>Checkout Instructions</h3>
<p>
<b>Prerequisites:</b> install <a href="http://java.com">Java 6</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/shared/gdata/shared-sample-gdata
mvn source:jar install
cd ../shared-sample-docs
mvn source:jar install
cd ../../../docs-cmdline-sample
<i>[editor]</i> src/main/resources/client_secrets.json
mvn compile
mvn -q exec:java
</pre>
<h3>Setup Project in Eclipse</h3>
<p>
<b>Prerequisites:</b> install <a href="http://www.eclipse.org/downloads/">Eclipse</a>,
the <a href="http://javaforge.com/project/HGE">Mercurial plugin</a>, and the
<a href="http://m2eclipse.sonatype.org/installing-m2eclipse.html">Maven
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>docs-cmdline-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/docs-cmdline-sample
</code> and click "Next"
</li>
<li>Click "Finish"</li>
</ul>
</li>
<li>Run
<ul>
<li>Right-click on project docs-cmdline-sample</li>
<li>Run As > Java Application</li>
<li>If asked, type "DocsSample" and click OK</li>
</ul>
</li>
</ul>
</body>
</html>