[opencms-dev] Custom I_CmsFileNameGenerator or CmsDefaultFileNameGenerator

Sandrine Prousteau s.prousteau at eurelis.com
Tue Mar 21 10:16:25 CET 2023


Hi

On OpenCms 13 or higher, how to use a custom implementation of
I_CmsFileNameGenerator, in order to take into account a custom macro
(%(date), replaced by "yyyy-MM-dd-" formatted current date on resource
creation)?

I've tried to set if in my module handler, but it doesn't work :

OpenCms.*getResourceManager*().setNameGenerator(*new*
CmsCustomFileNameGenerator());
generate this error :
*org.opencms.configuration.CmsConfigurationException: The resource manager
configuration is possible only during system startup. {}*

PS : I still need the %(number) macro.


Thanks.

Sandrine P.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opencms.org/pipermail/opencms-dev/attachments/20230321/775d6b08/attachment.htm>


More information about the opencms-dev mailing list