12-14-2017 11:02 AM
Hi,
I overridden the calendar create event webscript in my all in one project. When i go to http://localhost:8081/alfresco/s/index I can see the calendar/create webscript. When i go to details it shows me both the webscripts (mine and OOTB).
Custom at Store: classpath:alfresco/extension/templates/webscripts
OITB at Store: classpath:alfresco/templates/webscripts
However, whenever I create a new event, it always calls the OOTB webscript only. I've created the java controller at the same path as OOTB (org.alfresco.repo.web.scripts.calendar.CalendarEntryPost), but my custom java controller is never getting called.
Webscript location:
POST /alfresco/s/calendar/create
Below is my project structure and the webscript entry in the webscript-context.xml.
Thank you
12-14-2017 04:34 PM
Which Alfresco version are you using? Since Alfresco has decoupled the Repository and Share, some Repository-tier components required to run Share are shipped as a module (Alfresco Share Services). Between modules, there is no guaranteed order in which Spring configuration files are loaded, so it may very likely be that the bean in your module is actually being overriden by the bean from the Share Services module. Generally, it is very bad style to try to override Spring beans within modules - that is what the extension path is for. Put the Spring context file in alfresco/extension/ and your override will likely work right off the bat.
12-18-2017 03:46 PM
Thanks for your reply Axel Faust
I am using Alfresco 5.2.1
I have the JAVA class and ftl, desc.xml file in maven project imported in Intellij. I put the webscript spring entry in C:\alfresco-content-services\tomcat\shared\classes\alfresco\extension\web-scripts-config-custom.xml .
After restarting the server I found it is still not taking the custom implementation! Is there anything that I am missing!?
Thanks,
Sanket Shah
12-18-2017 03:48 PM
Why are you suddently naming your file web-scripts-config-custom.xml instead of webscript-context.xml? With that of course it does not work...
12-19-2017 10:16 AM
Hi,
In my previous post by mistake I put the wrong file name. The file name is custom-web-context.xml. This is the file at \tomcat\shared\classes\alfresco\extension\ having JAVA webscript controller entries.
I did it because I found in tomcat\webapps\alfresco\WEB-INF\web-application-context.xml .
So I put everything in this file. But it is still not taking!
Thank you for your reply!
12-29-2017 10:21 AM
Finally, I solved it.
I was creating the custom class with the same name and in the same package as of OOTB. That was the reason it was not taking it even though I was putting it into custom-web-context.xml.
I renamed my class to something else and it starts picking it up.
Thanks for your time everyone
Explore our Alfresco products with the links below. Use labels to filter content by product module.