[opencms-dev] Custom I_CmsFileNameGenerator or CmsDefaultFileNameGenerator

Daniel Seidel d.seidel at alkacon.com
Tue Mar 21 10:19:28 CET 2023


Hi Sandrine,

in the opencms-vfs.xml, right above the <mimetypes> element you have to 
add an element <namegenerator class="my.custom.FileNameGenerator" />

Best, Daniel.

Am 21.03.23 um 10:16 schrieb Sandrine Prousteau via opencms-dev:
> 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.
>
> _______________________________________________
> This mail is sent to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> https://lists.opencms.org/mailman/listinfo/opencms-dev
>
>
>
-- 
Kind Regards

Daniel.

-------------------

Daniel Seidel
Alkacon Software GmbH & Co. KG - The OpenCms Experts
https://www.alkacon.com  -http://www.opencms.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opencms.org/pipermail/opencms-dev/attachments/20230321/f7f4078d/attachment.htm>


More information about the opencms-dev mailing list