YouTube

Got a YouTube account?

New: enable viewer-created translations and captions on your YouTube channel!

English subtitles

← Updating saveProfile - Developing Scalable Apps with Java

Get Embed Code
4 Languages

Showing Revision 5 created 05/25/2016 by Udacity Robot.

  1. Now you're going to write the code to make
  2. sure that the user's logged in, if they
  3. try to use the saveProfile function. Look for
  4. the places marked TODO 2 in the saveProfile
  5. method in the Conference API class. You're going to
  6. want to go ahead and add final User
  7. user as the first argument to saveProfile. The
  8. user argument has to be the first argument and
  9. the argument that defines the data structure of the
  10. input fields is the second argument and in our case,
  11. that's profile form. Then go ahead and add the
  12. check to make sure that the user is logged in.
  13. If the user is null, throw an UnauthorizedException exception.
  14. You'll also want to get the userid. And the users
  15. email out of the user object that gets passed
  16. in. And then use the user id and email to
  17. set the appropriate fields. Test your app by
  18. using the API's Explorer on local host. You should
  19. find, that when you try to use the saveProfile
  20. method. You must be logged in and you can
  21. use that simulation button in the top right
  22. of the API's Explorer to simulate logging in. When
  23. you've made your code changes and verified they work
  24. on local host, go ahead and deploy to appspot.
  25. Then go ahead and enter your APP Id here, so that Udacity can test your app