On Thu, Jul 31, 2014 at 6:55 PM, Pascal BASTIEN <[email protected]> wrote: > 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/xwiki-platform-ldap/xwiki-platform-ldap-authenticator/src/main/java/com/xpn/xwiki/plugin/ldap/XWikiLDAPUtils.java > > but I don't know how to call it in groovy script.
You will have to configure a new instance of XWikiLDAPUtils for that. You can do like the LDAP authenticator in https://github.com/xwiki/xwiki-platform/blob/master/xwiki-platform-core/xwiki-platform-ldap/xwiki-platform-ldap-authenticator/src/main/java/com/xpn/xwiki/user/impl/LDAP/XWikiLDAPAuthServiceImpl.java#L281 > > > ________________________________ > De : Thomas Mortagne <[email protected]> > À : Pascal BASTIEN <[email protected]> > Cc : XWiki Users <[email protected]> > 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 <[email protected]> > 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 > > > -- Thomas Mortagne _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
