cancel
Showing results for 
Search instead for 
Did you mean: 

4.0 Extension - override webscript get.config.xml

loftux
Star Contributor
Star Contributor
I've tried to override filter.get.config.xml with
            <customization>
               <targetPackageRoot>org.alfresco.components.documentlibrary</targetPackageRoot>
               <sourcePackageRoot>se.loftux.extension.components.documentlibrary</sourcePackageRoot>
            </customization>
and put my new filter.get.config.xml in shared/classes/webscripts/se/loftux/extension/components/documentlibrary.
My new config doesn't get picked up.
Probably just missing something obvious. I've tried multiple locations for the file, the above location is my most likely candidate  :?
If what I'm trying to do is supported (or when you add support for it) it would be nice if it extended the default config, so that in this case I just add the extra filter I want, or if you want to override add replace="true".

I think it would be good to have som examples of file locations, Davids blog posts have some info, but I think it needs to be typed out in a table listing or something. It gets confusing, why does template override go in classes/alfresco/templates, but webscripts in classes/alfresco (and not in classes/alfresco/site-webscripts something)?
2 REPLIES 2

ddraper
World-Class Innovator
World-Class Innovator
Unfortunately WebScript config customizations are not currently supported (only i18n properties, JavaScript controllers and FreeMarker templates), this is why the extension is not having any effect.

Regards,
Dave

ddraper
World-Class Innovator
World-Class Innovator
I didn't have the time to answer all your questions in my post yesterday but thought it best to stop you spending more time fruitlessly trying to get WebScript config extensions to work…

The file location issue is slightly more complex and is all to do with the configuration of the various stores in the Spring application context. WebScripts files, standalone FreeMarker templates (i.e. that are not rendered as part of a WebScript, e.g. the Spring Surf TemplateInstances) and Spring Surf configuration objects all search different stores to find the files that they can use.

As a general rule for extensions you can assume that…
Surf configuration objects should be placed in "alfresco/site-data/{object-type}" (on the classpath)
Templates should be placed in "alfresco/templates/{package-path}" (on the classpath)
WebScripts should be placed in "alfresco/site-webscripts/{any sub-path} (on the classpath)

This is of course not the complete story - Spring Surf can retrieve different files from all sorts of locations and it is all entirely configurable through the Spring application context through the creation of stores and persisters (which are incredibly badly named because some persisters are read-only!) and overriding the persister and object services.

All of this is further complicated by the auto-wire service which also dynamically modifies where files can be loaded from.

As said, this is all unnecessarily complicated but we are caught between supporting existing releases (including existing customizations that are out in there in the world) and simplifying Spring Surf. We're hoping to improve the understanding through blogging and through responding to questions (such as yours) on this forum. There are many blog posts that I'd like to do, the challenge is finding the time to write them - the subject of file lookup is definitely high on the list though and hopefully I'll get to it soon!

I hope this helps somewhat, if not actually providing you with the solution to extend WebScript configurations,

Regards,
Dave