cancel
Showing results for 
Search instead for 
Did you mean: 

Reload extension module configuration

kamielvdz
Champ in-the-making
Champ in-the-making
Is there a way to reload a specific extension module in Share. I have several extension modules defined in /shared/classes/alfresco/web-extension/sita-data/extensions and want to be able to reload them without restarting the application.

I tried undeploying it and then redeploying, but to no effect. 
7 REPLIES 7

kaynezhang
World-Class Innovator
World-Class Innovator
Why do you want reload extension module? if you want to debug extension module you can deploy Files and Folders instead of a jar.
and enable springSurf development mode
   <alfresco-config>
       <config evaluator="string-compare" condition="WebFramework">
           <web-framework>
               <!– Autowire Runtime Settings –>
               <autowire>
                   <!– Pick the mode: development, preview, production –>
                   <mode>development</mode>
               </autowire>
           </web-framework>
       </config>
   </alfresco-config>
if you enable development  javascript and templates will be not cached.

kamielvdz
Champ in-the-making
Champ in-the-making
I do not want to debug. I have specific alfresco-config statements in these extensions, which are site specific. I want to let an admin change some of these settings on the fly. If extension modules could be reloaded this would be ideal for this. I just overwrite the specific XML config element, reload the extension and we are up and running.

I already have an alternative to this by using a custom file outside of the normal Share Config and doing a reload of all Alfresco objects, but since Alfresco extension modules are able to have a <configuration> section, this would seem much more apprioriate.

Btw reloading Alfresco Share Config (I use devtools for this) reloads the config in share-config-custom files, but not the configuration in all the web-extension/extenion/*-module.xml files.



zladuric
Champ on-the-rise
Champ on-the-rise
Well, since Alfresco is built on Spring, you could utilize Spring to do this? Ie. add a method 'reloadConfiguration', which will re-load the bean definition or configuration or whatever. Is that an option for you?

kamielvdz
Champ in-the-making
Champ in-the-making
Thx for the suggestion. I am not sure how these extensions actually work or if these are reloadable beans. I probably have to look at the SURF framework more closely. Anyone who has tried that will know how easy that is…

ddraper
World-Class Innovator
World-Class Innovator
The extension modules themselves are Surf Objects and are loaded via the classpath at server startup. You can dynamically deploy and undeploy the extensions loaded at server startup but changing the XML definitions on the running server will have no effect until the server is restarted. The org.springframework.extensions.surf.ModuleDeploymentService does have methods that allow modules to be added to and removed from the "default persisted" extension - this is done via the /modules/module and /modules/module/delete WebScripts - however, this is NOT the same as editing an Extension XML file that exists in the server classpath, but it would at least address your problem of updating modules (by removing and adding a replacement) without a server restart.

…and as always, we appreciate the dig at Surf Smiley Wink

kamielvdz
Champ in-the-making
Champ in-the-making
Thank you ddraper, that answers my question.

And don't get me wrong. Surf is a great framework, but without looking at the source code I can't find much.

ddraper
World-Class Innovator
World-Class Innovator
You're welcome… and don't worry, we know that the documentation for Surf is sadly lacking, the problem is finding the time to do something about it ! Smiley Happy