Namespace value not being set when GAE app invoked from Google Apps
I have integrated the app with google apps marketplace. When the app is invoked from drop down "more" link on google apps(universal navigation bar), i expect the apps namespace key to be automatically set to the domain value but it's not happening.
The value returned by NamespaceManager.getGoogleAppsNamespace() is "". Any idea what I might be doing wrong? Thank you for your help.
public class NamespaceFilter implements Filter {
.....
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
throws IOException, ServletException {
case GOOGLE_APPS_DOMAIN : {
NamespaceManager.set(NamespaceManager.getGoogleAppsNamespace());
Update: I am going to try explicitly setting the namespace value to the value carried by com.google.appengine.api.users.UserService.user_organization instead of NamespaceManager.getGoogleAppsNamespace() method. I wish the latter worked but it's not. user_organization is being set correctly to the calling domain on the oth开发者_开发知识库er hand.
You have to manage the Namespace in Appengine yourself. AppEngine is not aware of the google apps marketplace. Use the domain parameter to set the Appengine namespace manually.
The problem might be the way the application is accessed. Is it yourapp.yourcustomerdomain.com
, yourapp.appspot.com
or even www.yourapp.com
?
Tested on my own apps the expected results of the method call are following:
- for
yourapp.yourcustomerdomain.com
it isyourcustomerdomain.com
- for
yourapp.appspot.com
it is empty - for
www.yourapp.com
it isyourapp.com
So given what you've written you need the application deployed the first way.
精彩评论