<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: What's the correct way to reuse LDAP beans/connection settings? in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/what-s-the-correct-way-to-reuse-ldap-beans-connection-settings/m-p/291207#M244337</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You don't need to define your action bean in /extension/subsystems/Synchronization/ldap/ldap1/my-ldap-context.xml or import common-ldap-context.xml. You can define your action in regular way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can try to do it like this:&lt;BR /&gt;1.Make your action implements spring &lt;SPAN&gt;InitializingBean and&amp;nbsp;&lt;/SPAN&gt;In your action reference interface ChildApplicationContextManager&lt;BR /&gt;public class YourAction implements InitializingBean{&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;private ChildApplicationContextManager authenticationContextManager;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;private LDAPInitialDirContextFactory ldapInitialDirContextFactory;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;public void setAuthenticationContextManager(ChildApplicationContextManager authenticationContextManager) {&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;this.authenticationContextManager = authenticationContextManager;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;@Override&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;public void afterPropertiesSet() throws Exception {&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;for(String contextName : authenticationContextManager.getInstanceIds()){&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ApplicationContext ctx = authenticationContextManager.getApplicationContext(contextName);&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;try{&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ldapInitialDirContextFactory = LDAPInitialDirContextFactory)&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ctx.getBean(LDAPInitialDirContextFactory.class);&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;} catch(NoSuchBeanDefinitionException e) {}&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;BR /&gt;}&lt;BR /&gt;2.And in your action spring file inject Authentication bean to your action authenticationContextManager property&lt;BR /&gt;&amp;lt;property name="authenticationContextManager" ref="Authentication" /&amp;gt;&lt;BR /&gt;3. override afterPropertiesSet method of your action and get ldapInitialDirContextFactory bean like previous code.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 28 Nov 2016 16:32:24 GMT</pubDate>
    <dc:creator>kaynezhang</dc:creator>
    <dc:date>2016-11-28T16:32:24Z</dc:date>
    <item>
      <title>What's the correct way to reuse LDAP beans/connection settings?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/what-s-the-correct-way-to-reuse-ldap-beans-connection-settings/m-p/291206#M244336</link>
      <description>I'm trying to create an action which accesses LDAP.If I define the action bean in /extension/subsystems/Synchronization/ldap/ldap1/my-ldap-context.xml then I would normally expect to be able to access it using org.alfresco.repo.management.subsystems.SubsystemProxyFactory but that doesn't work for th</description>
      <pubDate>Mon, 28 Nov 2016 15:16:34 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/what-s-the-correct-way-to-reuse-ldap-beans-connection-settings/m-p/291206#M244336</guid>
      <dc:creator>idwright</dc:creator>
      <dc:date>2016-11-28T15:16:34Z</dc:date>
    </item>
    <item>
      <title>Re: What's the correct way to reuse LDAP beans/connection settings?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/what-s-the-correct-way-to-reuse-ldap-beans-connection-settings/m-p/291207#M244337</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You don't need to define your action bean in /extension/subsystems/Synchronization/ldap/ldap1/my-ldap-context.xml or import common-ldap-context.xml. You can define your action in regular way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can try to do it like this:&lt;BR /&gt;1.Make your action implements spring &lt;SPAN&gt;InitializingBean and&amp;nbsp;&lt;/SPAN&gt;In your action reference interface ChildApplicationContextManager&lt;BR /&gt;public class YourAction implements InitializingBean{&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;private ChildApplicationContextManager authenticationContextManager;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;private LDAPInitialDirContextFactory ldapInitialDirContextFactory;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;public void setAuthenticationContextManager(ChildApplicationContextManager authenticationContextManager) {&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;this.authenticationContextManager = authenticationContextManager;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;@Override&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;public void afterPropertiesSet() throws Exception {&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;for(String contextName : authenticationContextManager.getInstanceIds()){&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ApplicationContext ctx = authenticationContextManager.getApplicationContext(contextName);&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;try{&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ldapInitialDirContextFactory = LDAPInitialDirContextFactory)&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ctx.getBean(LDAPInitialDirContextFactory.class);&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;} catch(NoSuchBeanDefinitionException e) {}&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;BR /&gt;}&lt;BR /&gt;2.And in your action spring file inject Authentication bean to your action authenticationContextManager property&lt;BR /&gt;&amp;lt;property name="authenticationContextManager" ref="Authentication" /&amp;gt;&lt;BR /&gt;3. override afterPropertiesSet method of your action and get ldapInitialDirContextFactory bean like previous code.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Nov 2016 16:32:24 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/what-s-the-correct-way-to-reuse-ldap-beans-connection-settings/m-p/291207#M244337</guid>
      <dc:creator>kaynezhang</dc:creator>
      <dc:date>2016-11-28T16:32:24Z</dc:date>
    </item>
    <item>
      <title>Re: What's the correct way to reuse LDAP beans/connection settings?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/what-s-the-correct-way-to-reuse-ldap-beans-connection-settings/m-p/291208#M244338</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I see this has had quite a lot of views recently so thought it might be helpful to add a link to the implementation I ended up with:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://github.com/cggh/cggh-alfresco-extensions/tree/master/auth-platform-jar" title="https://github.com/cggh/cggh-alfresco-extensions/tree/master/auth-platform-jar" rel="nofollow noopener noreferrer"&gt;cggh-alfresco-extensions/auth-platform-jar at master · cggh/cggh-alfresco-extensions · GitHub&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Dec 2018 10:17:49 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/what-s-the-correct-way-to-reuse-ldap-beans-connection-settings/m-p/291208#M244338</guid>
      <dc:creator>idwright</dc:creator>
      <dc:date>2018-12-06T10:17:49Z</dc:date>
    </item>
  </channel>
</rss>

