【问题标题】:provide custom namespace while configuring Alfresco LDAP integration在配置 Alfresco LDAP 集成时提供自定义命名空间
【发布时间】:2020-10-09 15:48:36
【问题描述】:

我有一个带有 ldap-ad 用户/组同步的 Alfresco Community 5.2 安装,并且一切正常。

现在我必须添加一个带有一些属性的方面并让 ldap 处理它们,将它们添加到 cm:person。 所以我按照建议的here 定制了common-ldap-context.xml,但我只使用cm: 前缀作为aspect/property 命名空间,让它覆盖原来的Alfresco 内容模型。

如果我使用我的个人模型前缀,每当我启动 Alfresco 时,我都会从 spring 加载 common-ldap-context.xml 文件中收到“unkown namespace”错误。

如何将我的命名空间导入该文件?我是否可能必须使用 cm: 前缀?

这是我的 common-ldap-context.xml 片段

<property name="personAttributeMapping">
    <map>
        <!-- ... -->
        <entry key="myc:prop1">
           <value>${ldap.synchronization.prop1</value>
        </entry>
        <entry key="myc:prop2">
            <value>${ldap.synchronization.prop2</value>
        </entry>
        <entry key="myc:prop3">
           <value>${ldap.synchronization.prop3</value>
        </entry>
        <entry key="myc:prop4">
            <value>${ldap.synchronization.prop4</value>
        </entry>
        <!-- ... -->
    </map>
</property>

common-ldap-context.xml 中的 personAttributeMapping 被放置在路径 Alfresco/tomcat/shared/classes/alfresco/extension/Authentication/ldap-context.xml 中。自定义文档模型在bean组件中定义,从bootstrap.context.xml中加载

谢谢。

【问题讨论】:

  • 我猜这是在 Alfresco 引导期间加载顺序的问题。您是如何自定义/部署 personAttributeMapping 和包含所需方面的自定义文档模型的?
  • @HeikoRobert,你如何处理加载顺序?
  • 你是对的。我也刚刚创建了一个简单的模型,在初始化spring bean时得到了未知的命名空间异常。
  • 我们如何处理引导顺序?

标签: spring ldap alfresco


【解决方案1】:

我定义了所需的 bean 提示 depends-on="..."(当然使用您的 bean 名称加载模型)。

所以我的custom-ldap-context.xmlin extension/subsystems/Authentication/ldap-ad/ldap-ad1(文件夹取决于您配置的子系统)看起来像:

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
<!--
   Bean definitions shared by the ldap and ldap-ad subsystems
-->

<beans>

   <!-- Regularly exports user and group information from LDAP -->

        <bean id="ecm4u.personDetails.dictionaryBootstrap" parent="dictionaryModelBootstrap" depends-on="dictionaryBootstrap">
                <property name="models">
                        <list>
                                <value>alfresco/extension/personDetails.xml</value>
                        </list>
                </property>
        </bean>

<bean id="userRegistry" class="org.alfresco.repo.security.sync.ldap.LDAPUserRegistry" depends-on="ecm4u.personDetails.dictionaryBootstrap">

<!-- snap -->

      <property name="personAttributeMapping">
         <map>

<!-- snap -->

           <!-- BEGIN New properties -->
            <entry key="pd:employeeNumber">
               <value>${ldap.synchronization.userEmployeeNumberAttributeName}</value>
            </entry>
            <!-- END New properties -->

<!-- snap -->

【讨论】:

    猜你喜欢
    • 2015-10-24
    • 2018-04-28
    • 1970-01-01
    • 1970-01-01
    • 2011-05-15
    • 1970-01-01
    • 2020-02-06
    • 1970-01-01
    相关资源
    最近更新 更多