Refactor JCR utils and home usage
authorMathieu Baudier <mbaudier@argeo.org>
Wed, 22 Aug 2012 15:26:10 +0000 (15:26 +0000)
committerMathieu Baudier <mbaudier@argeo.org>
Wed, 22 Aug 2012 15:26:10 +0000 (15:26 +0000)
git-svn-id: https://svn.argeo.org/commons/trunk@5537 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc

15 files changed:
base/runtime/org.argeo.eclipse.ui.jcr/src/main/java/org/argeo/eclipse/ui/jcr/JcrPreferenceStore.java
security/plugins/org.argeo.security.ui.admin/src/main/java/org/argeo/security/ui/admin/editors/ArgeoUserEditor.java
security/plugins/org.argeo.security.ui.admin/src/main/java/org/argeo/security/ui/admin/views/UsersView.java
security/plugins/org.argeo.security.ui.admin/src/main/java/org/argeo/security/ui/admin/wizards/NewUserWizard.java
security/runtime/org.argeo.security.core/src/main/java/org/argeo/security/jcr/RemoteJcrAuthenticationProvider.java
security/runtime/org.argeo.security.ldap/src/main/java/org/argeo/security/ldap/jcr/JcrUserDetailsContextMapper.java
server/plugins/org.argeo.jcr.ui.explorer/src/main/java/org/argeo/jcr/ui/explorer/browser/NodeContentProvider.java
server/plugins/org.argeo.jcr.ui.explorer/src/main/java/org/argeo/jcr/ui/explorer/commands/AddRemoteRepository.java
server/plugins/org.argeo.jcr.ui.explorer/src/main/java/org/argeo/jcr/ui/explorer/model/RepositoriesNode.java
server/runtime/org.argeo.server.jackrabbit/src/main/java/org/argeo/jackrabbit/remote/SimpleSessionProvider.java
server/runtime/org.argeo.server.jcr/src/main/java/org/argeo/jcr/ArgeoJcrConstants.java
server/runtime/org.argeo.server.jcr/src/main/java/org/argeo/jcr/ArgeoJcrUtils.java
server/runtime/org.argeo.server.jcr/src/main/java/org/argeo/jcr/UserJcrUtils.java [new file with mode: 0644]
server/runtime/org.argeo.server.jcr/src/main/java/org/argeo/jcr/security/JcrKeyring.java
server/runtime/org.argeo.server.jcr/src/main/java/org/argeo/jcr/security/SecurityJcrUtils.java

index 93d0f045474e3fa43ecb1c9eb7cd2f96cf7412c6..ba32b1da43f53153441f9c574c1177bb5ecaee85 100644 (file)
@@ -29,10 +29,10 @@ import javax.jcr.version.VersionManager;
 
 import org.apache.commons.io.IOUtils;
 import org.argeo.ArgeoException;
-import org.argeo.jcr.ArgeoJcrUtils;
 import org.argeo.jcr.ArgeoNames;
 import org.argeo.jcr.ArgeoTypes;
 import org.argeo.jcr.JcrUtils;
+import org.argeo.jcr.UserJcrUtils;
 import org.eclipse.jface.preference.PreferenceStore;
 import org.eclipse.ui.preferences.ScopedPreferenceStore;
 import org.osgi.framework.BundleContext;
@@ -53,7 +53,7 @@ public class JcrPreferenceStore extends PreferenceStore implements ArgeoNames {
                try {
                        if (session.hasPendingChanges())
                                session.save();
-                       Node userHome = ArgeoJcrUtils.getUserHome(session);
+                       Node userHome = UserJcrUtils.getUserHome(session);
                        if (userHome == null)
                                throw new ArgeoException("No user home for "
                                                + session.getUserID());
index fab34323af2bfd93f5ebd805b14cca6230df46c8..3ea3cf81660c048c56cabb7b63423b631e445233 100644 (file)
@@ -20,8 +20,8 @@ import javax.jcr.RepositoryException;
 import javax.jcr.Session;
 
 import org.argeo.ArgeoException;
-import org.argeo.jcr.ArgeoJcrUtils;
 import org.argeo.jcr.ArgeoNames;
+import org.argeo.jcr.UserJcrUtils;
 import org.argeo.security.UserAdminService;
 import org.argeo.security.jcr.JcrUserDetails;
 import org.argeo.security.ui.admin.SecurityAdminPlugin;
@@ -48,7 +48,7 @@ public class ArgeoUserEditor extends FormEditor {
                super.init(site, input);
                String username = ((ArgeoUserEditorInput) getEditorInput())
                                .getUsername();
-               userHome = ArgeoJcrUtils.getUserHome(session, username);
+               userHome = UserJcrUtils.getUserHome(session, username);
 
                if (userAdminService.userExists(username)) {
                        userDetails = (JcrUserDetails) userAdminService
index 254149b095f4c279476d395b391224c46e8aa028..ca89aef446dc49c8c6a9b0360d56545fedf15a77 100644 (file)
@@ -34,13 +34,13 @@ import org.argeo.eclipse.ui.specific.EclipseUiSpecificUtils;
 import org.argeo.jcr.ArgeoNames;
 import org.argeo.jcr.ArgeoTypes;
 import org.argeo.jcr.JcrUtils;
+import org.argeo.jcr.UserJcrUtils;
 import org.argeo.security.ui.admin.SecurityAdminPlugin;
 import org.argeo.security.ui.admin.commands.OpenArgeoUserEditor;
 import org.eclipse.core.commands.Command;
 import org.eclipse.core.commands.IParameter;
 import org.eclipse.core.commands.Parameterization;
 import org.eclipse.core.commands.ParameterizedCommand;
-import org.eclipse.jface.resource.JFaceResources;
 import org.eclipse.jface.viewers.ColumnLabelProvider;
 import org.eclipse.jface.viewers.DoubleClickEvent;
 import org.eclipse.jface.viewers.IDoubleClickListener;
@@ -87,7 +87,7 @@ public class UsersView extends ViewPart implements ArgeoNames, ArgeoTypes {
 
                userStructureListener = new UserStructureListener();
                JcrUtils.addListener(session, userStructureListener, Event.NODE_ADDED
-                               | Event.NODE_REMOVED, JcrUtils.DEFAULT_HOME_BASE_PATH,
+                               | Event.NODE_REMOVED, UserJcrUtils.DEFAULT_HOME_BASE_PATH,
                                ArgeoTypes.ARGEO_USER_HOME);
        }
 
index a4cd0edb8a4ee06e89ea8777d819e648b99c625a..40a243f9422c47122b4f2c2dd4c4fc00320257f2 100644 (file)
@@ -22,8 +22,8 @@ import javax.jcr.Session;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.argeo.eclipse.ui.ErrorFeedback;
-import org.argeo.jcr.ArgeoJcrUtils;
 import org.argeo.jcr.JcrUtils;
+import org.argeo.jcr.UserJcrUtils;
 import org.argeo.jcr.security.SecurityJcrUtils;
 import org.argeo.security.UserAdminService;
 import org.argeo.security.jcr.JcrUserDetails;
@@ -72,7 +72,7 @@ public class NewUserWizard extends Wizard {
                        return true;
                } catch (Exception e) {
                        JcrUtils.discardQuietly(session);
-                       Node userHome = ArgeoJcrUtils.getUserHome(session, username);
+                       Node userHome = UserJcrUtils.getUserHome(session, username);
                        if (userHome != null) {
                                try {
                                        userHome.remove();
index 62dc982147b66334e8adc3ee97a457c2e9add0e5..f61d37ab2abb951d0996124fef31608dc035843d 100644 (file)
@@ -31,8 +31,8 @@ import javax.jcr.Value;
 
 import org.argeo.ArgeoException;
 import org.argeo.jcr.ArgeoJcrConstants;
-import org.argeo.jcr.ArgeoJcrUtils;
 import org.argeo.jcr.ArgeoNames;
+import org.argeo.jcr.UserJcrUtils;
 import org.argeo.security.NodeAuthenticationToken;
 import org.springframework.security.Authentication;
 import org.springframework.security.AuthenticationException;
@@ -65,7 +65,7 @@ public class RemoteJcrAuthenticationProvider implements AuthenticationProvider,
 
                        String workspace = siteAuth.getSecurityWorkspace();
                        session = repository.login(sp, workspace);
-                       Node userHome = ArgeoJcrUtils.getUserHome(session);
+                       Node userHome = UserJcrUtils.getUserHome(session);
                        if (userHome == null || !userHome.hasNode(ArgeoNames.ARGEO_PROFILE))
                                throw new ArgeoException("No profile for user "
                                                + siteAuth.getName() + " in security workspace "
index 72c120728354e660c2e7edf9d1fb9937e85a23f2..03260bfb7d02f855b7d6ca0e2013e26e658da46a 100644 (file)
@@ -23,9 +23,9 @@ import javax.jcr.RepositoryException;
 import javax.jcr.Session;
 
 import org.argeo.ArgeoException;
-import org.argeo.jcr.ArgeoJcrUtils;
 import org.argeo.jcr.ArgeoNames;
 import org.argeo.jcr.JcrUtils;
+import org.argeo.jcr.UserJcrUtils;
 import org.argeo.security.jcr.JcrUserDetails;
 import org.springframework.ldap.core.DirContextAdapter;
 import org.springframework.ldap.core.DirContextOperations;
@@ -61,7 +61,7 @@ public class JcrUserDetailsContextMapper implements UserDetailsContextMapper,
                        final String username, GrantedAuthority[] authorities) {
                if (ctx == null)
                        throw new ArgeoException("No LDAP information for user " + username);
-               Node userHome = ArgeoJcrUtils.getUserHome(securitySession, username);
+               Node userHome = UserJcrUtils.getUserHome(securitySession, username);
                if (userHome == null)
                        throw new ArgeoException("No JCR information for user " + username);
 
index a1aca2b20ca3e608612e08184a1adcae67b92206..34466d301f2faa60132383cdec3365216e9c472e 100644 (file)
@@ -25,8 +25,8 @@ import javax.jcr.Session;
 
 import org.argeo.eclipse.ui.TreeParent;
 import org.argeo.jcr.ArgeoJcrConstants;
-import org.argeo.jcr.ArgeoJcrUtils;
 import org.argeo.jcr.RepositoryRegister;
+import org.argeo.jcr.UserJcrUtils;
 import org.argeo.jcr.security.JcrKeyring;
 import org.argeo.jcr.ui.explorer.model.RepositoriesNode;
 import org.argeo.jcr.ui.explorer.model.SingleJcrNode;
@@ -72,7 +72,7 @@ public class NodeContentProvider implements ITreeContentProvider {
                        return;
 
                if (userSession != null) {
-                       Node userHome = ArgeoJcrUtils.getUserHome(userSession);
+                       Node userHome = UserJcrUtils.getUserHome(userSession);
                        if (userHome != null) {
                                // TODO : find a way to dynamically get alias for the node
                                if (homeNode != null)
index 7f101b8bc36e246634b4226af35270449ce95cf2..332e94444812628401438299ad94dab68850ec4c 100644 (file)
@@ -27,10 +27,10 @@ import javax.jcr.SimpleCredentials;
 import org.argeo.ArgeoException;
 import org.argeo.eclipse.ui.ErrorFeedback;
 import org.argeo.jcr.ArgeoJcrConstants;
-import org.argeo.jcr.ArgeoJcrUtils;
 import org.argeo.jcr.ArgeoNames;
 import org.argeo.jcr.ArgeoTypes;
 import org.argeo.jcr.JcrUtils;
+import org.argeo.jcr.UserJcrUtils;
 import org.argeo.jcr.security.JcrKeyring;
 import org.argeo.jcr.security.SecurityJcrUtils;
 import org.argeo.jcr.ui.explorer.JcrExplorerConstants;
@@ -160,7 +160,7 @@ public class AddRemoteRepository extends AbstractHandler implements
                protected void okPressed() {
                        try {
                                Session nodeSession = keyring.getSession();
-                               Node home = ArgeoJcrUtils.getUserHome(nodeSession);
+                               Node home = UserJcrUtils.getUserHome(nodeSession);
 
                                // FIXME better deal with non existing home dir
                                if (home == null)
index 3289b420da16542bc1870e6eee524a0d7b346d43..52ed4c2ef4bb1f56b61350cd95b421139bcf6ff3 100644 (file)
@@ -29,9 +29,9 @@ import org.argeo.ArgeoException;
 import org.argeo.eclipse.ui.ErrorFeedback;
 import org.argeo.eclipse.ui.TreeParent;
 import org.argeo.jcr.ArgeoJcrConstants;
-import org.argeo.jcr.ArgeoJcrUtils;
 import org.argeo.jcr.ArgeoNames;
 import org.argeo.jcr.RepositoryRegister;
+import org.argeo.jcr.UserJcrUtils;
 import org.argeo.jcr.security.JcrKeyring;
 
 /**
@@ -93,7 +93,7 @@ public class RepositoriesNode extends TreeParent implements ArgeoNames {
        protected void addRemoteRepositories(JcrKeyring jcrKeyring)
                        throws RepositoryException {
                Session userSession = jcrKeyring.getSession();
-               Node userHome = ArgeoJcrUtils.getUserHome(userSession);
+               Node userHome = UserJcrUtils.getUserHome(userSession);
                if (userHome != null && userHome.hasNode(ARGEO_REMOTE)) {
                        NodeIterator it = userHome.getNode(ARGEO_REMOTE).getNodes();
                        while (it.hasNext()) {
index 54e12bd7d52226110eaed212c41b9d61849964d3..acec8218086e57eb7fe3279cafd1a6477ae745e5 100644 (file)
@@ -40,9 +40,9 @@ import org.apache.jackrabbit.api.security.user.User;
 import org.apache.jackrabbit.api.security.user.UserManager;
 import org.apache.jackrabbit.server.SessionProvider;
 import org.argeo.ArgeoException;
-import org.argeo.jcr.ArgeoJcrUtils;
 import org.argeo.jcr.ArgeoNames;
 import org.argeo.jcr.JcrUtils;
+import org.argeo.jcr.UserJcrUtils;
 
 /**
  * Implements an open session in view patter: a new JCR session is created for
@@ -119,7 +119,7 @@ public class SimpleSessionProvider implements SessionProvider, Serializable {
                                userGroupIds.add(it.next().getID());
 
                // write roles if needed
-               Node userProfile = ArgeoJcrUtils.getUserHome(session).getNode(
+               Node userProfile = UserJcrUtils.getUserHome(session).getNode(
                                ArgeoNames.ARGEO_PROFILE);
                boolean writeRoles = false;
                if (userProfile.hasProperty(ArgeoNames.ARGEO_REMOTE_ROLES)) {
index a0068cf0f6ae81187885cd574c391ef9d6c024f2..5cfb1d0fa79cf3940c88a6ebaf40df09880efd31 100644 (file)
@@ -20,8 +20,6 @@ public interface ArgeoJcrConstants {
        public final static String ARGEO_BASE_PATH = "/argeo:system";
        public final static String DATA_MODELS_BASE_PATH = ARGEO_BASE_PATH
                        + "/argeo:dataModels";
-       /** The home base path. Not yet configurable */
-       public final static String DEFAULT_HOME_BASE_PATH = "/argeo:home";
 
        // parameters (typically for call to a RepositoryFactory)
        public final static String JCR_REPOSITORY_ALIAS = "argeo.jcr.repository.alias";
index b0d775779a7f5fa4053077c8480cbee551900c4d..ed4ba421f53ac03c420ad6c7b6a3c9e2ac1d8485 100644 (file)
@@ -3,64 +3,14 @@ package org.argeo.jcr;
 import java.util.HashMap;
 import java.util.Map;
 
-import javax.jcr.Node;
 import javax.jcr.Repository;
 import javax.jcr.RepositoryException;
 import javax.jcr.RepositoryFactory;
-import javax.jcr.Session;
 
 import org.argeo.ArgeoException;
 
 /** Utilities related to Argeo model in JCR */
 public class ArgeoJcrUtils implements ArgeoJcrConstants {
-       /**
-        * Returns the home node of the session user or null if none was found.
-        * 
-        * @param session
-        *            the session to use in order to perform the search, this can be
-        *            a session with a different user ID than the one searched,
-        *            typically when a system or admin session is used.
-        * @param username
-        *            the username of the user
-        */
-       public static Node getUserHome(Session session, String username) {
-               try {
-                       String homePath = ArgeoJcrUtils.getUserHomePath(username);
-                       return session.itemExists(homePath) ? session.getNode(homePath)
-                                       : null;
-                       // kept for example of QOM queries
-                       // QueryObjectModelFactory qomf = session.getWorkspace()
-                       // .getQueryManager().getQOMFactory();
-                       // Selector userHomeSel = qomf.selector(ArgeoTypes.ARGEO_USER_HOME,
-                       // "userHome");
-                       // DynamicOperand userIdDop = qomf.propertyValue("userHome",
-                       // ArgeoNames.ARGEO_USER_ID);
-                       // StaticOperand userIdSop = qomf.literal(session.getValueFactory()
-                       // .createValue(username));
-                       // Constraint constraint = qomf.comparison(userIdDop,
-                       // QueryObjectModelFactory.JCR_OPERATOR_EQUAL_TO, userIdSop);
-                       // Query query = qomf.createQuery(userHomeSel, constraint, null,
-                       // null);
-                       // Node userHome = JcrUtils.querySingleNode(query);
-               } catch (RepositoryException e) {
-                       throw new ArgeoException("Cannot find home for user " + username, e);
-               }
-       }
-
-       /** Returns the home node of the session user or null if none was found. */
-       public static Node getUserHome(Session session) {
-               String userID = session.getUserID();
-               return getUserHome(session, userID);
-       }
-
-       /** @deprecated Use {@link #getUserHome(Session, String)} directly */
-       @Deprecated
-       public static String getUserHomePath(String username) {
-               String homeBasePath = DEFAULT_HOME_BASE_PATH;
-               return homeBasePath + '/' + JcrUtils.firstCharsToPath(username, 2)
-                               + '/' + username;
-       }
-
        /**
         * Wraps the call to the repository factory based on parameter
         * {@link ArgeoJcrConstants#JCR_REPOSITORY_ALIAS} in order to simplify it
diff --git a/server/runtime/org.argeo.server.jcr/src/main/java/org/argeo/jcr/UserJcrUtils.java b/server/runtime/org.argeo.server.jcr/src/main/java/org/argeo/jcr/UserJcrUtils.java
new file mode 100644 (file)
index 0000000..016347a
--- /dev/null
@@ -0,0 +1,64 @@
+package org.argeo.jcr;
+
+import javax.jcr.Node;
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+
+import org.argeo.ArgeoException;
+
+/** Utilities related to the user home and properties based on Argeo JCR model. */
+public class UserJcrUtils {
+       /** The home base path. Not yet configurable */
+       public final static String DEFAULT_HOME_BASE_PATH = "/argeo:home";
+
+       private UserJcrUtils() {
+       }
+
+       /**
+        * Returns the home node of the session user or null if none was found.
+        * 
+        * @param session
+        *            the session to use in order to perform the search, this can be
+        *            a session with a different user ID than the one searched,
+        *            typically when a system or admin session is used.
+        * @param username
+        *            the username of the user
+        */
+       public static Node getUserHome(Session session, String username) {
+               try {
+                       String homePath = UserJcrUtils.getUserHomePath(username);
+                       return session.itemExists(homePath) ? session.getNode(homePath)
+                                       : null;
+                       // kept for example of QOM queries
+                       // QueryObjectModelFactory qomf = session.getWorkspace()
+                       // .getQueryManager().getQOMFactory();
+                       // Selector userHomeSel = qomf.selector(ArgeoTypes.ARGEO_USER_HOME,
+                       // "userHome");
+                       // DynamicOperand userIdDop = qomf.propertyValue("userHome",
+                       // ArgeoNames.ARGEO_USER_ID);
+                       // StaticOperand userIdSop = qomf.literal(session.getValueFactory()
+                       // .createValue(username));
+                       // Constraint constraint = qomf.comparison(userIdDop,
+                       // QueryObjectModelFactory.JCR_OPERATOR_EQUAL_TO, userIdSop);
+                       // Query query = qomf.createQuery(userHomeSel, constraint, null,
+                       // null);
+                       // Node userHome = JcrUtils.querySingleNode(query);
+               } catch (RepositoryException e) {
+                       throw new ArgeoException("Cannot find home for user " + username, e);
+               }
+       }
+
+       /** Returns the home node of the session user or null if none was found. */
+       public static Node getUserHome(Session session) {
+               String userID = session.getUserID();
+               return getUserHome(session, userID);
+       }
+
+       /** @deprecated Use {@link getUserHome} directly */
+       @Deprecated
+       static String getUserHomePath(String username) {
+               String homeBasePath = DEFAULT_HOME_BASE_PATH;
+               return homeBasePath + '/' + JcrUtils.firstCharsToPath(username, 2)
+                               + '/' + username;
+       }
+}
index 91dd202011f261de9e9d7838ef3abfee1dea9319..a35bbd2724a878f30bc8cdd0a3d15f6b25d67d57 100644 (file)
@@ -31,10 +31,10 @@ import javax.jcr.Session;
 
 import org.apache.commons.io.IOUtils;
 import org.argeo.ArgeoException;
-import org.argeo.jcr.ArgeoJcrUtils;
 import org.argeo.jcr.ArgeoNames;
 import org.argeo.jcr.ArgeoTypes;
 import org.argeo.jcr.JcrUtils;
+import org.argeo.jcr.UserJcrUtils;
 import org.argeo.util.crypto.AbstractKeyring;
 import org.argeo.util.crypto.PBEKeySpecCallback;
 
@@ -63,7 +63,7 @@ public class JcrKeyring extends AbstractKeyring implements ArgeoNames {
                        if (notYetSavedKeyring.get() != null)
                                return true;
 
-                       Node userHome = ArgeoJcrUtils.getUserHome(session);
+                       Node userHome = UserJcrUtils.getUserHome(session);
                        return userHome.hasNode(ARGEO_KEYRING);
                } catch (RepositoryException e) {
                        throw new ArgeoException("Cannot check whether keyring is setup", e);
@@ -75,7 +75,7 @@ public class JcrKeyring extends AbstractKeyring implements ArgeoNames {
                Binary binary = null;
                InputStream in = null;
                try {
-                       Node userHome = ArgeoJcrUtils.getUserHome(session);
+                       Node userHome = UserJcrUtils.getUserHome(session);
                        if (userHome.hasNode(ARGEO_KEYRING))
                                throw new ArgeoException("Keyring already setup");
                        Node keyring = userHome.addNode(ARGEO_KEYRING);
@@ -126,7 +126,7 @@ public class JcrKeyring extends AbstractKeyring implements ArgeoNames {
        @Override
        protected void handleKeySpecCallback(PBEKeySpecCallback pbeCallback) {
                try {
-                       Node userHome = ArgeoJcrUtils.getUserHome(session);
+                       Node userHome = UserJcrUtils.getUserHome(session);
                        Node keyring;
                        if (userHome.hasNode(ARGEO_KEYRING))
                                keyring = userHome.getNode(ARGEO_KEYRING);
@@ -250,7 +250,7 @@ public class JcrKeyring extends AbstractKeyring implements ArgeoNames {
 
        protected Cipher createCipher() {
                try {
-                       Node userHome = ArgeoJcrUtils.getUserHome(session);
+                       Node userHome = UserJcrUtils.getUserHome(session);
                        if (!userHome.hasNode(ARGEO_KEYRING))
                                throw new ArgeoException("Keyring not setup");
                        Node keyring = userHome.getNode(ARGEO_KEYRING);
index abf4347db4bc930ab24e2c53853415471d5b3c4c..1ba42197e049ae4ea955f64f2847df913ca74e36 100644 (file)
@@ -7,10 +7,10 @@ import javax.jcr.version.VersionManager;
 
 import org.argeo.ArgeoException;
 import org.argeo.jcr.ArgeoJcrConstants;
-import org.argeo.jcr.ArgeoJcrUtils;
 import org.argeo.jcr.ArgeoNames;
 import org.argeo.jcr.ArgeoTypes;
 import org.argeo.jcr.JcrUtils;
+import org.argeo.jcr.UserJcrUtils;
 
 /** Utilities related to Argeo security model in JCR */
 public class SecurityJcrUtils implements ArgeoJcrConstants {
@@ -39,7 +39,7 @@ public class SecurityJcrUtils implements ArgeoJcrConstants {
        }
 
        private static String generateUserHomePath(String username) {
-               String homeBasePath = DEFAULT_HOME_BASE_PATH;
+               String homeBasePath = UserJcrUtils.DEFAULT_HOME_BASE_PATH;
                return homeBasePath + '/' + JcrUtils.firstCharsToPath(username, 2)
                                + '/' + username;
        }
@@ -105,7 +105,7 @@ public class SecurityJcrUtils implements ArgeoJcrConstants {
         */
        public static Node getUserProfile(Session session, String username) {
                try {
-                       Node userHome = ArgeoJcrUtils.getUserHome(session, username);
+                       Node userHome = UserJcrUtils.getUserHome(session, username);
                        if (userHome == null)
                                return null;
                        if (userHome.hasNode(ArgeoNames.ARGEO_PROFILE))