When I enter the app from the app's login page by entering Google App's email id and password, everything works fine. Namespace is being set to the domain name. However, when I enter the app from Google Apps universal navigation link, Namespace is being set to blank instead of the domain name. After a quick troubleshooting session, I found that NamespaceManager.
After some delving into App Engine's API source code, I came up with a workaround that I can use until I find the root cause of why the original approach didn't work.
case GOOGLE_APPS_DOMAIN: {
/*
* Original code. Commented out because getGoogleAppsNamespace
* not returning the apps domain name. Unable to find out the
* reason
*/
// NamespaceManager.set(NamespaceManager.getGoogleAppsNamespace());
if (NamespaceManager.getGoogleAppsNamespace().equals("")) {
Object userOrganizationObject;
String userOrganization;
userOrganizationObject = com.google.apphosting.api.ApiProxy
.getCurrentEnvironment()
.getAttributes()
.get("com.google.appengine.api.users.UserService.user_organization");
if (userOrganizationObject == null) {
userOrganization = "";
} else {
userOrganization = userOrganizationObject.toString();
}
NamespaceManager.set(userOrganization);
} else {
NamespaceManager.set(NamespaceManager
.getGoogleAppsNamespace());
}
break;
}
No comments:
Post a Comment