Author: keith
Date: Wed Apr 23 01:43:30 2008
New Revision: 16029
Log:
More changes due to registry changes. Now we need to get the reals from the
userRegitry instead of using the wsasRealm directly
Modified:
trunk/mashup/java/modules/core/src/org/wso2/mashup/webapp/identity/RegistrationBean.java
trunk/mashup/java/modules/core/src/org/wso2/mashup/webapp/userprofile/AddUserBean.java
trunk/mashup/java/modules/core/src/org/wso2/mashup/webapp/utils/RegistryUtils.java
trunk/mashup/java/modules/javascriptdeployer/src/org/wso2/mashup/deployer/JSDeployer.java
Modified:
trunk/mashup/java/modules/core/src/org/wso2/mashup/webapp/identity/RegistrationBean.java
==============================================================================
---
trunk/mashup/java/modules/core/src/org/wso2/mashup/webapp/identity/RegistrationBean.java
(original)
+++
trunk/mashup/java/modules/core/src/org/wso2/mashup/webapp/identity/RegistrationBean.java
Wed Apr 23 01:43:30 2008
@@ -173,7 +173,7 @@
String adminEmail = "".equals(emailId.trim()) ? "none" :
emailId;
// Create the admin user profile.
- RegistryUtils.createUser(systemRegistry, realm, userName,
+ RegistryUtils.createUser(systemRegistry, userName,
adminName, adminEmail, "System
Administrator");
// Assign primary user the 'admin' role and make primary.
userStoreAdmin.addUserToRole(userName,
RegistryConstants.ADMIN_ROLE);
@@ -287,7 +287,7 @@
// Create secure registry instance using the admin ID.
UserRegistry systemRegistry = embeddedRegistry.getSystemRegistry();
// Add user to registry.
- RegistryUtils.createUser(systemRegistry, realm, userName,
fullName, eMail, fullName);
+ RegistryUtils.createUser(systemRegistry, userName, fullName,
eMail, fullName);
isAuthorized = true;
} catch (UserStoreException e) {
log.error("Error adding user to role", e);
Modified:
trunk/mashup/java/modules/core/src/org/wso2/mashup/webapp/userprofile/AddUserBean.java
==============================================================================
---
trunk/mashup/java/modules/core/src/org/wso2/mashup/webapp/userprofile/AddUserBean.java
(original)
+++
trunk/mashup/java/modules/core/src/org/wso2/mashup/webapp/userprofile/AddUserBean.java
Wed Apr 23 01:43:30 2008
@@ -190,7 +190,7 @@
userStoreAdmin.addUser(userName, password);
// Use a utility method to create the profile in the registry.
- RegistryUtils.createUser(registry, realm, userName, fullName,
emailId, bio);
+ RegistryUtils.createUser(registry, userName, fullName, emailId,
bio);
created = true;
} catch (UserStoreException e) {
log.error("Error adding user in user manager", e);
Modified:
trunk/mashup/java/modules/core/src/org/wso2/mashup/webapp/utils/RegistryUtils.java
==============================================================================
---
trunk/mashup/java/modules/core/src/org/wso2/mashup/webapp/utils/RegistryUtils.java
(original)
+++
trunk/mashup/java/modules/core/src/org/wso2/mashup/webapp/utils/RegistryUtils.java
Wed Apr 23 01:43:30 2008
@@ -563,7 +563,6 @@
* this user authority to modify his or her own profile.
*
* @param systemRegistry Instance of the JDBC registry.
- * @param realm User manager realm instance.
* @param userName Name of user to add to registry.
* @param fullName Full name of user.
* @param eMailId User's e-mail ID.
@@ -571,10 +570,11 @@
* @throws UserStoreException Thrown in case a exception occurs in
usermanager
* @throws RegistryException Thrown in case a exception occurs in the
registry
*/
- public static void createUser(Registry systemRegistry, UserRealm realm,
String userName,
+ public static void createUser(UserRegistry systemRegistry, String userName,
String fullName, String eMailId, String bio)
throws UserStoreException, RegistryException {
+ UserRealm realm = systemRegistry.getUserRealm();
UserStoreAdmin userStoreAdmin = realm.getUserStoreAdmin();
AccessControlAdmin controlAdmin = realm.getAccessControlAdmin();
Modified:
trunk/mashup/java/modules/javascriptdeployer/src/org/wso2/mashup/deployer/JSDeployer.java
==============================================================================
---
trunk/mashup/java/modules/javascriptdeployer/src/org/wso2/mashup/deployer/JSDeployer.java
(original)
+++
trunk/mashup/java/modules/javascriptdeployer/src/org/wso2/mashup/deployer/JSDeployer.java
Wed Apr 23 01:43:30 2008
@@ -1263,16 +1263,16 @@
AccessControlConstants.READ);
// Create the anonymous user profile.
- RegistryUtils.createUser(userRegistry, realm,
+ RegistryUtils.createUser(userRegistry,
RegistryConstants.ANONYMOUS_USER,
"Visitor", "none",
"Anonymous user");
// Create the system user profile.
- RegistryUtils.createUser(userRegistry, realm,
MashupConstants.SYSTEM_USER,
+ RegistryUtils.createUser(userRegistry,
MashupConstants.SYSTEM_USER,
"System", "none", "System User");
// Create the samples user and profile.
- RegistryUtils.createUser(userRegistry, realm,
MashupConstants.SAMPLES_USER,
+ RegistryUtils.createUser(userRegistry,
MashupConstants.SAMPLES_USER,
"Samples", "none", "Samples User");
}
@@ -1280,7 +1280,7 @@
if (createPrimary && !MashupUtils.isInitialSetupComplete()) {
//Create the admin profile using information from a config
file.
RegistryUtils
- .createUser(userRegistry, realm, primaryName,
primaryName, "none",
+ .createUser(userRegistry, primaryName, primaryName,
"none",
"System Administrator");
// Assign system user the 'admin' role and make primary.
us.addUserToRole(primaryName, RegistryConstants.ADMIN_ROLE);
_______________________________________________
Mashup-dev mailing list
[email protected]
http://www.wso2.org/cgi-bin/mailman/listinfo/mashup-dev