Auto reloading in the portal module

Hi,

as i created the portal example for a blog post i made recently, i was faced with the situation that code auto reloading on the portal module does not work. But not only on the Controllers, even on the Freemarker templates. Is there an technical reasons for this? When one is coming from developing in the normal cuba web app then this feels like going a huge step back.

If there is no real technical reason, would it be possible to activate it like in the normal web app? That would be great! :slight_smile:

Bye,
Mario

Hi Mario,

In fact, hot deploy is easily customizable - see Help > Settings > Hot deploy settings > Edit. In this dialog, you can set up source and destination folders for automatic copying of modified files.
By default, the settings include only standard CUBA UI and configuration, but you can add your portal folders containing HTML and JavaScript too. We do not include them by default because portals can be very different. But perhaps you are right, we should provide some settings at least for our own portal template.

Hi Konstantin,

thanks for the hint. Didn’t know about that setting, this will probably be enough for now. But if you consider adding a default when creating the portal app: great!

Bye,
Mario

Hi Konstantin,

i tried to change the settings as you can see in the attached image. Unfortunately it did not change anything - freemaker templates are not reloaded. Am i missing something here, or are the settings just wrong that i added?
Additionally after closing the project in studio and reopen it, the adjusted settings are gone. Is this the default behavior?

Bye,
Mario

hot-deploy-settings

Hi Mario,
You are probably right, freemarker templates are cached on the server and the platform doesn’t take any actions to invalidate the cache when the file is replaced (as it does for beans, messages, etc.). But automatic copying files from sources to deployment folders works well for HTML/JS/CSS, because browser loads them on page refresh. So this is enough for pure JS client applications.
We will think about reloading server-side templates, thank you for pointing out the problem.

As for not saving the configuration in Studio - it can be a bug, we’ll check it and fix ASAP.

Hi, Mario.
The Hot deployment settings might be erased indeed:
When the OK button is pressed on the ‘STUDIO SETTINGS’ page, default ‘Hot deployment settings’ are applied if they were not changed that session.
To work around the issue, open and save ‘hot deploy settings’ every time you change studio settings.

Thank you for reporting the problem. It will be fixed in the next studio release.

The issue with unexpected deletion of hot deployment settings is fixed in the Studio v.2.1.4.

Cool, thanks!

:ticket: See the following issue in our bug tracker:

https://youtrack.cuba-platform.com/issue/STUDIO-2550