Yes you are right "services.ldap.resetGroupCache()" working well if I install
org.xwiki.platform:xwiki-platform-ldap-api 6.1.
To repopulate my ldap cache there are perhaps
* Get the cache with the provided name for a particular LDAP server.
*
* @param configuration the configuration to use to create the cache and to find it if
it's already created.
* @param context the XWiki context.
* @return the cache.
* @throws CacheException error when creating the cache.
* @since 4.1M1
*/
public Cache<Map<String, String>> getGroupCache(CacheConfiguration
configuration, XWikiContext context)
https://github.com/xwiki/xwiki-platform/blob/master/xwiki-platform-core/xwi…
but I don't know how to call it in groovy script.
________________________________
De : Thomas Mortagne <thomas.mortagne(a)xwiki.com>
À : Pascal BASTIEN <pbasnews-xwiki(a)yahoo.fr>
Cc : XWiki Users <users(a)xwiki.org>
Envoyé le : Jeudi 31 juillet 2014 16h40
Objet : Re: [xwiki-users] about password and LDAP
Ha right it's possible the LDAP script service is not in the default
package. You can install it using Extension Manager in administration.
Either you search and install "LDAP Admin Application" that will
trigger it as dependency or you use "Advanced search" with id
"org.xwiki.platform:xwiki-platform-ldap-api" and the version of XWiki
you have.
On Thu, Jul 31, 2014 at 5:28 PM, Pascal BASTIEN <pbasnews-xwiki(a)yahoo.fr> wrote:
Thanks you.
In fact, I want to repopulate automaticelly my LDAP cache to avoid the time
for my first user connexion.
Your command seem to empty the cache containing LDAP groups .
Anyway I didn't manage to launch it, because I obtain this error :-/
javax.script.ScriptException: javax.script.ScriptException:
java.lang.NullPointerException: Cannot invoke method resetGroupCache() on
null object
at
Are there a way to refresh the ldap cache by cron or scheduled script?
Yes, any script can call resetGroupCache() in the LDAP script service.
For example in a groovy scheduler job that would be:
services.ldap.resetGroupCache()
--
Thomas Mortagne