cancel
Showing results for 
Search instead for 
Did you mean: 

updateDelay not forcing recompile of modified FTLs

tarh33l
Champ in-the-making
Champ in-the-making
Hi everyone,
      I'm developing some FTLs in Share and finally got fed up with having to bounce the webapp for each change I made. I started digging into this and found the following lines in "custom-slingshot-application-context.xml":

   <bean id="webframework.webscripts.templateprocessor.freemarker" class="org.springframework.extensions.webscripts.processor.FTLTemplateProcessor">
      <property name="searchPath" ref="webframework.webscripts.searchpath" />
      <property name="defaultEncoding"><value>UTF-8</value></property>
      <property name="updateDelay"><value>1</value></property>     
      <property name="templateProcessorRegistry" ref="webframework.webscripts.registry.templateprocessor" />
   </bean>

   <bean id="webframework.templates.templateprocessor.freemarker" class="org.springframework.extensions.webscripts.processor.FTLTemplateProcessor">
      <property name="searchPath" ref="webframework.templates.searchpath" />
      <property name="defaultEncoding"><value>UTF-8</value></property>
      <property name="updateDelay"><value>1</value></property>
      <property name="templateProcessorRegistry" ref="webframework.templates.registry.templateprocessor" />
   </bean>

I've changed "updateDelay" from the default of "0" to "1". This is supposed to tell the template processor to look for modified FTLs every second. Unfortunately, this is not working in Share (3.3.1). Does anyone know why this is the case? If not, is there an alternative way of forcing a refresh on modified FTLs (without a server restart)?

Thanks!
- Terence
4 REPLIES 4

mikeh
Star Contributor
Star Contributor
Add the following config to share-config-custom.xml in the tomcat/shared/classes/alfresco/web-extensions folder.
<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>

You don't need to bounce the webapp (although with the share.war deployed in a separate Tomcat server, this should only take 10 seconds or so…) you can reset the webscripts instead at /share/service/index

Finally, you can wrap the reset webscripts POST request in a simple script that calls curl if you like.

Thanks,
Mike

tarh33l
Champ in-the-making
Champ in-the-making
Thanks Mike. These FTLs are actually being created for Share pages, not webscripts. As a result, refreshing the webscripts doesn't work (although, if I change an FTL for a webscript, it works as expected). I added the config element to share-custom-config.xml and it works like a charm, thank you. Any idea why the configurations in the custom-slingshot XML aren't being picked up (or at least, updateDelay)?

- Terence

PS - I do have Share as a separate webapp, I was just being lazy and didn't want to keep restarting Smiley Happy

gregbpopstar
Champ on-the-rise
Champ on-the-rise
This development mode change to share-config-custom.xml doesn't seem to help me.

In Alfresco 3.4b, I seem to be having a problem getting little test changes to the templates (such as removing the toolbar region in documentlibrary.ftl) in <share webapp>/WEB-INF/classes/alfresco/templates/org/alfresco/templates to have any affect.  The changes don't seem to take affect for me even after I've restarted tomcat.

I'm guessing that I just don't understand some basic thing and I'm doing it wrong.  Anyone, If I've successfully pointed out my ignorance, let me know (nicely) and I'll be very grateful.

Thanks

mikeh
Star Contributor
Star Contributor
This development mode change to share-config-custom.xml doesn't seem to help me.

In Alfresco 3.4b, I seem to be having a problem getting little test changes to the templates (such as removing the toolbar region in documentlibrary.ftl) in <share webapp>/WEB-INF/classes/alfresco/templates/org/alfresco/templates to have any affect.  The changes don't seem to take affect for me even after I've restarted tomcat.

I'm guessing that I just don't understand some basic thing and I'm doing it wrong.  Anyone, If I've successfully pointed out my ignorance, let me know (nicely) and I'll be very grateful.

Thanks
The fact that it's not changing even after a restart means you're not changing what you think you are(!). Maybe post some code and we'll have a better time understanding what you're trying to achieve.

Edit: I can see you've already got another thread open about this issue, please post the code there instead.

Thanks,
Mike
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.