}
@SuppressWarnings("deprecation")
public boolean save(OrganizationService service, String user, boolean isnewUser) throws Exception {
user_ = user;
UserProfileHandler hanlder = service.getUserProfileHandler();
UserProfile userProfile = hanlder.findUserProfileByName(user_);
if (userProfile == null) {
userProfile = hanlder.createUserProfileInstance();
userProfile.setUserName(user_);
}
for (UIComponent set : getChildren()) {
UIFormInputSet inputSet = (UIFormInputSet) set;
for (UIComponent uiComp : inputSet.getChildren()) {
UIFormStringInput uiInput = (UIFormStringInput) uiComp;
// if(uiInput.getValue() == null || uiInput.getValue().length() < 1)
// continue;
userProfile.getUserInfoMap().put(uiInput.getName(), uiInput.getValue());
}
}
WebuiRequestContext context = WebuiRequestContext.getCurrentInstance();
UIApplication uiApp = context.getUIApplication();
try {
hanlder.saveUserProfile(userProfile, true);
} catch (OAuthException gtnOauthOAuthException) {
// Show warning message if user with this facebookUsername (or googleUsername) already exists
if (gtnOauthOAuthException.getExceptionCode() == OAuthExceptionCode.DUPLICATE_OAUTH_PROVIDER_USERNAME) {
addOAuthExceptionMessage(context, gtnOauthOAuthException, uiApp);
return false;