cancel
Showing results for 
Search instead for 
Did you mean: 

rm-share-config-custom.xml for rm version 2.3.c

streetturtle
Confirmed Champ
Confirmed Champ
In the latest version of Records-Management it's possible to create a custom share-config for records management -
rm-share-config-custom.xml
, and work with it like in the document management. It's possible because
rm-context.xml
has this option in the configuration bean:

rm-context.xml:


   <bean id="rm.custom.config" class="org.springframework.extensions.config.ConfigBootstrap" init-method="register">
      <property name="configService" ref="web.config" />
      <property name="configs">
         <list>
            <value>classpath:alfresco/rm-share-config.xml</value>
            <value>classpath:alfresco/rm-form-config.xml</value>
            <value>classpath:alfresco/rm-share-workflow-form-config.xml</value>
            <value>classpath:alfresco/rm-share-config-custom.xml</value>
         </list>
      </property>
   </bean>


But in the version 2.3.c this rm-share-config-custom option doesn't exists.

rm-context.xml from version 2.3.c:


    <bean id="rm.custom.config" class="org.springframework.extensions.config.ConfigBootstrap" init-method="register">
      <property name="configService" ref="web.config" />
      <property name="configs">
         <list>
            <value>classpath:alfresco/rm-share-config.xml</value>
            <value>classpath:alfresco/rm-form-config.xml</value>
            <value>classpath:alfresco/rm-share-workflow-form-config.xml</value>
         </list>
      </property>
   </bean>


I want to be able to create a custom share-config for version 2.3.c.
As far as I understand I need to override "rm.custom.config" bean and put this additional value there.
But when I tried it I got following exception:


SEVERE: Exception starting filter Authentication Filter
org.springframework.extensions.config.ConfigException: 05110000 Unable to locate evaluator implementation for 'rm-kind' for org.springframework.extensions.config.ConfigSectionImpl@5b80848c (evaluator=rm-kind condition=RECORD replace=false)
   at org.springframework.extensions.config.BaseConfigService.processSection(BaseConfigService.java:489)
   at org.springframework.extensions.config.BaseConfigService.getConfig(BaseConfigService.java:228)
   at org.springframework.extensions.config.BaseConfigService.getConfig(BaseConfigService.java:171)
   at org.springframework.extensions.config.BaseConfigService.getConfig(BaseConfigService.java:166)
   at org.alfresco.web.site.servlet.SSOAuthenticationFilter.init(SSOAuthenticationFilter.java:180)
   at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:281)
   at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:262)
   at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:107)
   at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4775)
   at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5452)
   at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
   at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
   at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
   at java.util.concurrent.FutureTask.run(FutureTask.java:262)
   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
   at java.lang.Thread.run(Thread.java:745)


This rm-kind evaluator comes from rm-form-config.xml, but I don't understand how my change could be related to this config file.

My question is why am I getting this exception and how to be able to add custom share-config without upgrading records-management?

P.S.As a workaround for the moment I overwrote the whole file and did changes there. But it's not a proper solution.
1 REPLY 1

sammasue
Champ in-the-making
Champ in-the-making
Hello,

I succeeded to have an rm-share-config-custom.xml by overriding the bean rm.custom.config. You need to create a spring context xml file in the right folder. To find the "right folder" I open the surf-config.xml and you can see the import order of the spring contexts. Yours should be imported after alfresco/web-extension/*-context.xml. Here an example of the surf-config.xml:

<!– Import Slingshot –>
   <import resource="classpath*:alfresco/slingshot-application-context.xml" />
   <import resource="classpath*:alfresco/slingshot-documentlibrary-context.xml" />
   <import resource="classpath*:alfresco/web-extension/*-context.xml" />
  
   <!– SURF: support for Surf application config –>
   <import resource="classpath*:org/springframework/extensions/surf/application/*-context.xml" />
  
   <!– SURF: support for custom application configuration overrides –>
   <import resource="classpath*:org/springframework/extensions/surf/override/*-context.xml" />


In my case I created a new spring context file in this folder {share}/amp/config/org/springframework/extensions/surf/override/, with this content:


<?xml version='1.0' encoding='UTF-8'?><!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN'
  'http://www.springframework.org/dtd/spring-beans.dtd'>

<beans>

  <bean id="rm.custom.config" class="org.springframework.extensions.config.ConfigBootstrap" init-method="register">
    <property name="configService" ref="web.config"/>
    <property name="configs">
      <list>
        <value>classpath:alfresco/rm-share-config.xml</value>
        <value>classpath:alfresco/rm-form-config.xml</value>
        <value>classpath:alfresco/rm-share-workflow-form-config.xml</value>
        <value>classpath:alfresco/rm-share-config-custom.xml</value>
      </list>
    </property>
  </bean>

</beans>