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.
Solved! Go to Solution.
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.
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.
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.
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?
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.
Thank you, it's working now <3
@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
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.
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.