How to redefine Spring bean from default-synchronization-context.xml

294 views Asked by At

In Alfresco 5.0d, many Spring context XML files are packaged inside JAR files. For example, the file default-synchronization-context.xml is contained in

tomcat/webapps/alfresco/WEB-INF/lib/alfresco-repository-5.0.d.jar

How do I redefine a Spring bean that is defined in this XML file and is used in the "Synchronization" subsystem?

I've tried to put an altered version of this XML file into

tomcat/shared/classes/alfresco/extension/subsystems/Synchronization/default 

which has no effect. The Spring context is not even loaded. Putting it directyl into

tomcat/shared/classes/alfresco/extension

at least causes the Spring context to be loaded. But any bean redefined in it only is used in the Authentication(!) subsystem but not in the Synchronization subsystem.

What is the correct way to redefine a Spring bean of the Synchronization subsystem?

Edit:

As requested in a comment I add a property from tomcat/shared/classes/alfresco-global.properties:

authentication.chain=ldap1:ldap1,alfrescoNtlm1:alfrescoNtlm
1

There are 1 answers

3
Krutik Jayswal On BEST ANSWER

It is the authentication.chain property which defines , from where we are fetching property file.

Below URL is description of that. alfresco/extension/subsystems/Authentication/alfrescoNtlm/alfrescoNtlm1/mychanges.properties

If you have noticed that alfrescoNtlm1 folder than,this folder name must match with the property value ldap1:ldap1,alfrescoNtlm1:alfrescoNtlm.(See Italic text)

In case of context file you can define context file in same folder with the name suffix as *-context

For more info, read content of below link,specially spring bean section.

https://wiki.alfresco.com/wiki/Alfresco_Subsystems#Spring_Beans

If this does not work,than disable existing one and create new file, inside extension folder.by seeing that file(default-synchronization-context.xml) i can say that its nothing but cronjob which fires after some interval, you need to define one cron job and some other configuration.