This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @ApiMethod(name = "insertQuote", scopes = {Constants.EMAIL_SCOPE}, | |
| clientIds = {Constants.WEB_CLIENT_ID, | |
| Constants.ANDROID_CLIENT_ID, | |
| com.google.api.server.spi.Constant.API_EXPLORER_CLIENT_ID}, | |
| audiences = {Constants.ANDROID_AUDIENCE}) | |
| public Quote insertQuote(Quote quote, User user) throws UnauthorizedException { | |
| if (user == null) throw new UnauthorizedException("User is Not Valid"); | |
| PersistenceManager mgr = getPersistenceManager(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.mindstorm.famousquotes.entity; | |
| public class Constants { | |
| public static final String WEB_CLIENT_ID = "756161739003-0l5c7ptti2j42l28j5anijr5mukks835.apps.googleusercontent.com"; | |
| public static final String ANDROID_CLIENT_ID = "756161739003-9e1gefoeo2f9tsnrbjchtsn2shfq7q8k.apps.googleusercontent.com"; | |
| public static final String ANDROID_AUDIENCE = WEB_CLIENT_ID; | |
| public static final String EMAIL_SCOPE = "https://www.googleapis.com/auth/userinfo.email"; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>Famous Quotes</title> | |
| </head> | |
| <body> | |
| <form action="javascript:void(0);"> | |
| <h2>List Quotes</h2> | |
| <div><input id="listQuote" type="submit" value="List Quotes"></div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>Famous Quotes</title> | |
| </head> | |
| <body> | |
| <form action="javascript:void(0);"> | |
| <h2>List Greetings</h2> | |
| <div><input id="listGreeting" type="submit" value="Submit"></div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.mindstorm.famousquotesandroid; | |
| import java.util.ArrayList; | |
| import java.util.HashMap; | |
| import java.util.Iterator; | |
| import java.util.List; | |
| import java.util.Map; | |
| import com.google.api.client.extensions.android.http.AndroidHttp; | |
| import com.google.api.client.json.gson.GsonFactory; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.mindstorm.famousquotesandroid; | |
| import android.app.Activity; | |
| import android.app.ProgressDialog; | |
| import android.content.Context; | |
| import android.os.AsyncTask; | |
| import android.os.Bundle; | |
| import android.util.Log; | |
| import android.view.View; | |
| import android.view.View.OnClickListener; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.mindstorm.famousquotesandroid; | |
| import java.io.IOException; | |
| import java.util.List; | |
| import com.google.api.client.extensions.android.http.AndroidHttp; | |
| import com.google.api.client.json.gson.GsonFactory; | |
| import com.mindstorm.famousquotes.entity.quoteendpoint.Quoteendpoint; | |
| import com.mindstorm.famousquotes.entity.quoteendpoint.model.CollectionResponseQuote; | |
| import com.mindstorm.famousquotes.entity.quoteendpoint.model.Quote; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.mindstorm.famousquotes.entity; | |
| import com.mindstorm.famousquotes.entity.PMF; | |
| import com.google.api.server.spi.config.Api; | |
| import com.google.api.server.spi.config.ApiMethod; | |
| import com.google.api.server.spi.config.ApiNamespace; | |
| import com.google.api.server.spi.response.CollectionResponse; | |
| import com.google.appengine.api.datastore.Cursor; | |
| import com.google.appengine.datanucleus.query.JDOCursorHelper; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.mindstorm.famousquotes.entity; | |
| import javax.jdo.annotations.IdGeneratorStrategy; | |
| import javax.jdo.annotations.IdentityType; | |
| import javax.jdo.annotations.PersistenceCapable; | |
| import javax.jdo.annotations.Persistent; | |
| import javax.jdo.annotations.PrimaryKey; | |
| @PersistenceCapable(identityType = IdentityType.APPLICATION) | |
| public class Quote { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.mindstorm.famousquotes.service; | |
| import java.util.ArrayList; | |
| import java.util.List; | |
| import com.google.api.server.spi.config.Api; | |
| import com.google.api.server.spi.config.ApiMethod; | |
| import com.google.api.server.spi.config.Named; | |
| import com.google.api.server.spi.response.NotFoundException; | |
| import com.mindstorm.famousquotes.entity.Quote; |