• e-mail addresses when using LDAP or DB auth.

  • OpenKM has many interesting features, but requires some configuration process to show its full potential.
OpenKM has many interesting features, but requires some configuration process to show its full potential.
Forum rules: Please, before asking something see the documentation wiki or use the search feature of the forum. And remember we don't have a crystal ball or mental readers, so if you post about an issue tell us which OpenKM are you using and also the browser and operating system version. For more info read How to Report Bugs Effectively.
 #964  by mmart
 
Is the openkm-emails.properties file only way to configure users e-mail addresses, especially when using LDAP or database for storing users and roles?

Regards,
Mart Moldau
 #965  by pavila
 
In this case, you should implement the es.git.openkm.core.principal.PrincipalAdapter interface.
 #972  by mmart
 
Sorry, but can you give me some more guidance. I see only getUsers() and getRoles() in PrincipalAdapter interface.

regards,
Mart Moldau
 #973  by pavila
 
You have to implement these two method which should return a list of users and roles in the LDAP. Search in the forum because there is some implemented code.
 #975  by mmart
 
Thank you for the links, jllort. I see that I must implement getMails method in addition to getUsers and getRoles.
But are you sure, that this will work, as I don\'t see this getMails method referenced anywhere in the sources?

regards,
Mart Moldau
 #976  by jllort
 
Get mails is referenced on this classes:
DirectNotificationModule
DirectAuthModule
UsersRolesPrincipalAdapter
PrincipalAdapter ( really the Interface )
DatabasePrincipalAdapter

Note that some of this classes are not on community edition, but someones yes.

Pavila he\'ll give more info about it to you.
 #1013  by mmart
 
Hi again

Maybe I\'m missing something, but can\'t find reference to getMails() nowhere in sources.
In the DirectNotificationModule I see user2mail method which gets email addresses from openkm-emails.properties.
For testing purposes I wrote my own PrincipalAdapter, other methods (getUsers and getRoles) got called but no activity for getMails().

Regards,
Mart Moldau
 #1017  by jllort
 
Is your principal adapter like this:

public interface PrincipalAdapter {

/**
* Method to retrieve all users from a authentication source.
*
* @return A Collection with all the users.
* @throws PrincipalAdapterException If any error occurs.
*/
public Collection<String> getUsers() throws PrincipalAdapterException;

/**
* Method to retrieve all roles from a authentication source.
*
* @return A Collection with all the roles.
* @throws PrincipalAdapterException If any error occurs.
*/
public Collection<String> getRoles() throws PrincipalAdapterException;

/**
* Method to retrieve the mail from a list of users.
*
* @param users A list of users.
* @return A list of user emails.
* @throws PrincipalAdapterException If any error occurs.
*/
public Collection<String> getMails(Collection<String> users) throws PrincipalAdapterException;
}

If not we\'ve found the problem, because it\'s the actual interface and problably on community edition is not still yet changed. Community edition goes some delayed compared with professional.
 #1018  by mmart
 
Yes, my adapters code is currently like this. There are more code in getUsers and getRoles and those are working fine and I can see corresponding messages in debug log, but no activity for getMails method. E-mail addresses are still taken from the properties file.
public class EEPrincipalAdapter implements es.git.openkm.core.PrincipalAdapter {
private static Logger log = LoggerFactory.getLogger(EEPrincipalAdapter.class);

public Collection getUsers() throws es.git.openkm.core.PrincipalAdapterException {
log.debug(\"EE getUsers()\");
ArrayList list = new ArrayList();
//...
return list;
}

public Collection getRoles() throws es.git.openkm.core.PrincipalAdapterException {
log.debug(\"EE getRoles()\");
ArrayList list = new ArrayList();
//...
return list;
}

public Collection getMails(Collection users)
throws PrincipalAdapterException {
log.debug(\"EE getMails()\");
return null;
}

}
Regards,
Mart Moldau

About Us

OpenKM is part of the management software. A management software is a program that facilitates the accomplishment of administrative tasks. OpenKM is a document management system that allows you to manage business content and workflow in a more efficient way. Document managers guarantee data protection by establishing information security for business content.