Hello Amjed,
Thanks for replying.
I have being trying what ever you guided to me
about UserManager class and adding users.
I have done a bit on this and this time facing some problem that is i
created a java class which implements the UserManager but i' m not bale to
make class file of it/compile it. I h've attached the java file with the
mail please have a look. I'm new to this & i' m sure i must have missed
something out of this.
Following are the bugs.
[sda_...@cad44 ~/Desktop]$ javac SuserManager.java
SuserManager.java:12: cannot find symbol
symbol : variable userId
location: class SuserManager
if(this.userService.exists(userId)){
^
SuserManager.java:12: cannot find symbol
symbol : variable userService
location: class SuserManager
if(this.userService.exists(userId)){
^
SuserManager.java:13: cannot find symbol
symbol : constructor AuthorizableExistsException()
location: class
org.apache.jackrabbit.api.security.user.AuthorizableExistsException
throw new AuthorizableExistsException();
^
SuserManager.java:16: cannot find symbol
symbol : variable userId
location: class SuserManager
user = this.userService.create(userId,password);
^
SuserManager.java:16: cannot find symbol
symbol : variable userService
location: class SuserManager
user = this.userService.create(userId,password);
^
5 errors
These were the bugs and i have one more question in my mind that is if we
are able to imply this custom UserManager class then what would be the
changes in the behaviour of the reopsitory.
Means we have to put some user and password string in the repository.xml and
after that we can use only those usernames and passwords for accessing the
repository.
Thanks
simer
import org.apache.jackrabbit.api.security.user.*;
import java.io.*;
import java.util.*;
import javax.jcr.RepositoryException;
import java.security.Principal;
import java.util.Iterator;
public class SuserManager implements UserManager{
public User createUser(String userID, String password)throws AuthorizableExistsException, RepositoryException {
User user = null;
if(this.userService.exists(userId)){
throw new AuthorizableExistsException();
}
try{
user = this.userService.create(userId,password);
}catch(Exception e){
throw new RepositoryException(e.getMessage());
}
return user;
}
public User createUser(String userID, String password, Principal
principal, String intermediatePath)
throws AuthorizableExistsException, RepositoryException {
return createUser(userID, password);
}
public Group createGroup(Principal principal) throws AuthorizableExistsException, RepositoryException{}
public Group createGroup(Principal principal, String intermediatePath) throws AuthorizableExistsException, RepositoryException{}
public Authorizable getAuthorizable(String id) throws RepositoryException{}
public Authorizable getAuthorizable(Principal principal) throws RepositoryException{}
public Iterator findAuthorizables(String propertyName, String value) throws RepositoryException {}
public Iterator findAuthorizables(String propertyName, String value, int searchType) throws RepositoryException{}
}