12-07-2019 06:40 PM
Hello,
I want to change a bit the FeedNotifier. To achieve it I have to add a few lines of code to FeedTaskProcessor.java.
How Can I override this file?
I'm using dockerized Alfresco 6.1.2 and I tried to create a "FeedTaskProcessor" class in "org.alfresco.repo.activities.feed" package in the "src/main/java" path in the my-project-platform project. But it does not work.
12-08-2019 06:34 AM
In first place I thought to override only the affected beans, no the entire context file, in your project's bootstrap-context.xml file.
But being a subsystem's bean, you have to override the route to the original context file (that is, my-project-platform/src/main/resources/alfresco/subsystems/ActivitiesFeed/default/), as extensions directory does not work, although I think it should be the place to override existing subsystem context files. I just checked a project where we override ooo subsystem context files, and we did not use extensions directory.
I don't know exactly which is the best practice for overriding subsystem's beans, the big ones of this forum could help you more than me at this, and I would be interested in understanding that too.
10-26-2021 05:55 AM
Previous sollution does not seem to be working anymore...
However, when I create a
src/main/resources/alfresco/extension/subsystems/ActivitiesFeed/default/default/custom-activities-feed-context.xml
file, it works (is it a deprecated method?). There I can override only some beans, I do not have to override them all.
@resplin mentioned also 7years ago something about custom-activities-context.xml file but it does not have acess to the subsystem's beans.
I find it really sad that it is documented nowhere.
12-08-2019 03:50 AM
There should be a spring bean which declares this class in the jar artifact. You should declare this bean in your project, and subsitute their class implementation with your own modified class.
12-08-2019 05:27 AM
Thank you. There is indeed a file called activities-feed-context.xml which includes this bean of my interest. But where should I put modified version of this file?
Originally it is in the "alfresco-repository/src/main/resources/alfresco/subsystems/ActivitiesFeed/default/" path, should I put it in the "my-project-platform/src/main/resources/alfresco/subsystems/ActivitiesFeed/default/" folder or maybe should I use the "extension" directory and put it in the "my-project-platform/src/main/resources/extension/alfresco/subsystems/ActivitiesFeed/default/" or maybe with other Spring beans in the "my-project-platform/src/main/resources/alfresco/module/my-project-platform/context" ?
Sorry for that trivial question but I'm really lost with those paths
EDIT. I tried to put it in the "my-project-platform/src/main/resources/alfresco/extension/subsystems/ActivitiesFeed/default/activities-feed-context.xml" but it does not work...
I created my own LocalFeedTaskProcessor, LocalFeedGenerator and FeedGenerator classes and I replaced their paths in the bean's class attribute inside the activities-feed-context.xml. Why it does not work?
12-08-2019 06:34 AM
In first place I thought to override only the affected beans, no the entire context file, in your project's bootstrap-context.xml file.
But being a subsystem's bean, you have to override the route to the original context file (that is, my-project-platform/src/main/resources/alfresco/subsystems/ActivitiesFeed/default/), as extensions directory does not work, although I think it should be the place to override existing subsystem context files. I just checked a project where we override ooo subsystem context files, and we did not use extensions directory.
I don't know exactly which is the best practice for overriding subsystem's beans, the big ones of this forum could help you more than me at this, and I would be interested in understanding that too.
12-08-2019 10:29 AM
Thank you, it's working now ❤️
@narkuss wrote:I don't know exactly which is the best practice for overriding subsystem's beans, the big ones of this forum could help you more than me at this, and I would be interested in understanding that too.
I would also really appreciate a short guide on this subject
10-26-2021 05:55 AM
Previous sollution does not seem to be working anymore...
However, when I create a
src/main/resources/alfresco/extension/subsystems/ActivitiesFeed/default/default/custom-activities-feed-context.xml
file, it works (is it a deprecated method?). There I can override only some beans, I do not have to override them all.
@resplin mentioned also 7years ago something about custom-activities-context.xml file but it does not have acess to the subsystem's beans.
I find it really sad that it is documented nowhere.
Explore our Alfresco products with the links below. Use labels to filter content by product module.