summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormconway <michael_conway@unc.edu>2013-06-05 19:13:12 (GMT)
committer mconway <michael_conway@unc.edu>2013-06-05 19:13:12 (GMT)
commitfbc1be0cb483f7e2af78b92d83a6c5372830148e (patch)
treebd0982dd0875f7991b6f53ab32be47e91f861517
parent2077b7e4db77a376b5d8f6b73b35eb09d6b7dfcb (diff)
downloadQCG-Data-fbc1be0cb483f7e2af78b92d83a6c5372830148e.zip
QCG-Data-fbc1be0cb483f7e2af78b92d83a6c5372830148e.tar.gz
QCG-Data-fbc1be0cb483f7e2af78b92d83a6c5372830148e.tar.bz2
[#1462] improvements to behavior of profile
-rwxr-xr-xidrop-web/grails-app/controllers/org/irods/mydrop/controller/ProfileController.groovy56
-rwxr-xr-xidrop-web/idrop-web-config2.groovy4
-rw-r--r--idrop-web/release_notes.txt2
-rwxr-xr-xidrop-web/web-app/js/mydrop/profile.js5
4 files changed, 33 insertions, 34 deletions
diff --git a/idrop-web/grails-app/controllers/org/irods/mydrop/controller/ProfileController.groovy b/idrop-web/grails-app/controllers/org/irods/mydrop/controller/ProfileController.groovy
index 39db3d9..0a750b5 100755
--- a/idrop-web/grails-app/controllers/org/irods/mydrop/controller/ProfileController.groovy
+++ b/idrop-web/grails-app/controllers/org/irods/mydrop/controller/ProfileController.groovy
@@ -2,7 +2,6 @@ package org.irods.mydrop.controller
import org.irods.jargon.core.connection.IRODSAccount
import org.irods.jargon.core.pub.IRODSAccessObjectFactory
-import org.irods.jargon.core.pub.UserAO
import org.irods.jargon.userprofile.UserProfile
import org.irods.mydrop.service.ProfileService
import org.jsoup.Jsoup
@@ -41,7 +40,7 @@ class ProfileController {
if (irodsAccount.userName == IRODSAccount.PUBLIC_USERNAME) {
render(view:"noProfileData")
} else {
-
+
try {
UserProfile userProfile = profileService.retrieveProfile(irodsAccount)
ProfileCommand profileCommand = new ProfileCommand()
@@ -59,53 +58,53 @@ class ProfileController {
profileCommand.postOfficeBox = Jsoup.clean(userProfile.userProfilePublicFields.postOfficeBox,Whitelist.basic())
profileCommand.telephoneNumber = Jsoup.clean(userProfile.userProfilePublicFields.telephoneNumber,Whitelist.basic())
profileCommand.title = Jsoup.clean(userProfile.userProfilePublicFields.title,Whitelist.basic())
-
+
render(view:"index", model:[userProfile:profileCommand])
} catch (Exception e) {
+ log.error("eception retrieving or creating user profile", e)
response.sendError(500,e.message)
}
}
-
}
-
+
/**
* Update the profile
* @return
*/
def updateProfile(ProfileCommand profileCommand) {
-
+
log.info("updateProfile")
log.info "profileCommand: ${profileCommand}"
-
- /**
- * If there is an error send back the view for redisplay with error messages
- */
- if (!profileCommand.validate()) {
- log.info("errors in page, returning with error info")
- flash.error = message(code:"error.data.error")
- render(view:"index", model:[userProfile:profileCommand])
- return
- }
-
- log.info("edits pass")
-
+
+ /**
+ * If there is an error send back the view for redisplay with error messages
+ */
+ if (!profileCommand.validate()) {
+ log.info("errors in page, returning with error info")
+ flash.error = message(code:"error.data.error")
+ render(view:"index", model:[userProfile:profileCommand])
+ return
+ }
+
+ log.info("edits pass")
+
/*
* Massage the params into the user profile
*/
-
+
UserProfile userProfile
try {
- userProfile = profileService.retrieveProfile(irodsAccount)
+ userProfile = profileService.retrieveProfile(irodsAccount)
} catch (Exception e) {
log.error("error retrieving user profile", e)
flash.error = e.message
render(view:"index", model:[userProfile:profileCommand])
return
}
-
+
userProfile.userName = irodsAccount.userName
userProfile.userProfilePublicFields.nickName = Jsoup.clean(profileCommand.nickName,Whitelist.basic())
userProfile.userProfilePublicFields.description = Jsoup.clean(profileCommand.description,Whitelist.basic())
@@ -121,7 +120,7 @@ class ProfileController {
userProfile.userProfilePublicFields.postOfficeBox = Jsoup.clean(profileCommand.postOfficeBox,Whitelist.basic())
userProfile.userProfilePublicFields.telephoneNumber = Jsoup.clean(profileCommand.telephoneNumber,Whitelist.basic())
userProfile.userProfilePublicFields.title = Jsoup.clean(profileCommand.title,Whitelist.basic())
-
+
log.info "updating profile...."
try {
profileService.updateProfile(irodsAccount, userProfile)
@@ -131,15 +130,12 @@ class ProfileController {
render(view:"index", model:[userProfile:profileCommand])
return
}
-
+
log.info "updated"
flash.message = message(code:"message.update.successful")
-
+
redirect(view:"index", model:[userProfile:profileCommand])
-
}
-
-
}
class ProfileCommand {
@@ -157,7 +153,7 @@ class ProfileCommand {
String postOfficeBox
String telephoneNumber
String title
-
+
static constraints = {
nickName(null:false)
givenName( null:false)
@@ -169,7 +165,7 @@ class ProfileCommand {
labeledURL(null:false)
postalAddress(null:false)
postalCode(null:false)
- postOfficeBox(null:false)
+ postOfficeBox(null:false)
telephoneNumber(null:false)
title(null:false)
}
diff --git a/idrop-web/idrop-web-config2.groovy b/idrop-web/idrop-web-config2.groovy
index 531dbda..8c8c3be 100755
--- a/idrop-web/idrop-web-config2.groovy
+++ b/idrop-web/idrop-web-config2.groovy
@@ -41,8 +41,8 @@ environments {
idrop.config.idrop.lite.use.applet.dir=false
*/
-idrop.config.idrop.lite.applet.jar="idrop-lite-2.0.0-jar-with-dependencies.jar"
-idrop.config.idrop.lite.codebase="http://iren-web.renci.org/idrop-release"
+idrop.config.idrop.lite.applet.jar="idrop-lite-2.0.1-SNAPSHOT-jar-with-dependencies.jar"
+idrop.config.idrop.lite.codebase="http://iren-web.renci.org/idrop-snapshot"
idrop.config.idrop.lite.use.applet.dir=false
/*
diff --git a/idrop-web/release_notes.txt b/idrop-web/release_notes.txt
index 99f9ab7..0958cc6 100644
--- a/idrop-web/release_notes.txt
+++ b/idrop-web/release_notes.txt
@@ -50,6 +50,8 @@ Note that the following bug and feature requests are logged in GForge with relat
**Nicer display when no files/folders to display in home page
**Gallery and browse view now configurable option in config.groovy
+*[#1462] Fix profile to tolerate no 'protected profile read/write' group, it will still write the profile but will not set permissions to that missing group
+
==Features==
*[#984] iDrop web '2.0' redesign effort
diff --git a/idrop-web/web-app/js/mydrop/profile.js b/idrop-web/web-app/js/mydrop/profile.js
index becbdfc..2f3dcf9 100755
--- a/idrop-web/web-app/js/mydrop/profile.js
+++ b/idrop-web/web-app/js/mydrop/profile.js
@@ -41,10 +41,11 @@ function updateUserProfile() {
* load the profile details information
*/
function loadProfileData() {
- var targetDiv = "#profileDataArea";
+ /*var targetDiv = "#profileDataArea";
lcSendValueAndCallbackHtmlAfterErrorCheckPreserveMessage(
"/profile/loadProfileData",
- targetDiv, targetDiv, null);
+ targetDiv, targetDiv, null);*/
+ window.location=context + '/profile/index';
}