<?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 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/291206#M244336</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm trying to create an action which accesses LDAP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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 the Authentication subsystem.&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;Cannot convert value of type [org.alfresco.repo.management.subsystems.DefaultChildApplicationContextManager] to required type [org.alfresco.repo.management.subsystems.ApplicationContextFactory] for property 'sourceApplicationContextFactory':&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;If I pull the bean definitions (&lt;SPAN style="color: #333333; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: pre; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff; display: inline !important; float: none;"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class="" style="box-sizing: border-box; color: #63a35c; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: pre; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff;"&gt;import&lt;/SPAN&gt;&lt;SPAN style="color: #333333; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: pre; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff; display: inline !important; float: none;"&gt; &lt;/SPAN&gt;&lt;SPAN class="" style="box-sizing: border-box; color: #795da3; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: pre; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff;"&gt;resource&lt;/SPAN&gt;&lt;SPAN style="color: #333333; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: pre; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff; display: inline !important; float: none;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="" style="box-sizing: border-box; color: #183691; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: pre; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff;"&gt;&lt;SPAN class="" style="box-sizing: border-box; color: #183691;"&gt;"&lt;/SPAN&gt;classpath:alfresco/subsystems/Authentication/common-ldap-context.xml&lt;SPAN class="" style="box-sizing: border-box; color: #183691;"&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #333333; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: pre; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff; display: inline !important; float: none;"&gt;/&amp;gt;&lt;/SPAN&gt;) into my context/actions-context.xml then chaos ensues&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What does work is to redefine ldapInitialDirContextFactory in the context file but that's not ideal.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any thoughts?&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 28 Nov 2016 15:16:34 GMT</pubDate>
    <dc:creator>idwright</dc:creator>
    <dc:date>2016-11-28T15:16:34Z</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>

